1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.gallery3d.ui; 18 19 import android.graphics.Bitmap; 20 import android.graphics.Rect; 21 import android.graphics.RectF; 22 23 import com.android.gallery3d.glrenderer.BasicTexture; 24 import com.android.gallery3d.glrenderer.GLCanvas; 25 import com.android.gallery3d.glrenderer.GLId; 26 import com.android.gallery3d.glrenderer.GLPaint; 27 import com.android.gallery3d.glrenderer.RawTexture; 28 29 import java.nio.ByteBuffer; 30 import java.nio.FloatBuffer; 31 32 import javax.microedition.khronos.opengles.GL11; 33 34 public class GLCanvasStub implements GLCanvas { 35 @Override 36 public void setSize(int width, int height) {} 37 @Override 38 public void clearBuffer() {} 39 @Override 40 public void clearBuffer(float[] argb) {} 41 public void setCurrentAnimationTimeMillis(long time) {} 42 public long currentAnimationTimeMillis() { 43 throw new UnsupportedOperationException(); 44 } 45 @Override 46 public void setAlpha(float alpha) {} 47 @Override 48 public float getAlpha() { 49 throw new UnsupportedOperationException(); 50 } 51 @Override 52 public void multiplyAlpha(float alpha) {} 53 @Override 54 public void translate(float x, float y, float z) {} 55 @Override 56 public void translate(float x, float y) {} 57 @Override 58 public void scale(float sx, float sy, float sz) {} 59 @Override 60 public void rotate(float angle, float x, float y, float z) {} 61 public boolean clipRect(int left, int top, int right, int bottom) { 62 throw new UnsupportedOperationException(); 63 } 64 @Override 65 public void save() { 66 throw new UnsupportedOperationException(); 67 } 68 @Override 69 public void save(int saveFlags) { 70 throw new UnsupportedOperationException(); 71 } 72 public void setBlendEnabled(boolean enabled) {} 73 @Override 74 public void restore() {} 75 @Override 76 public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint) {} 77 @Override 78 public void drawRect(float x1, float y1, float x2, float y2, GLPaint paint) {} 79 @Override 80 public void fillRect(float x, float y, float width, float height, int color) {} 81 @Override 82 public void drawTexture( 83 BasicTexture texture, int x, int y, int width, int height) {} 84 @Override 85 public void drawMesh(BasicTexture tex, int x, int y, int xyBuffer, 86 int uvBuffer, int indexBuffer, int indexCount) {} 87 public void drawTexture(BasicTexture texture, 88 int x, int y, int width, int height, float alpha) {} 89 @Override 90 public void drawTexture(BasicTexture texture, RectF source, RectF target) {} 91 @Override 92 public void drawTexture(BasicTexture texture, float[] mTextureTransform, 93 int x, int y, int w, int h) {} 94 public void drawMixed(BasicTexture from, BasicTexture to, 95 float ratio, int x, int y, int w, int h) {} 96 @Override 97 public void drawMixed(BasicTexture from, int to, 98 float ratio, int x, int y, int w, int h) {} 99 public void drawMixed(BasicTexture from, BasicTexture to, 100 float ratio, int x, int y, int width, int height, float alpha) {} 101 public BasicTexture copyTexture(int x, int y, int width, int height) { 102 throw new UnsupportedOperationException(); 103 } 104 public GL11 getGLInstance() { 105 throw new UnsupportedOperationException(); 106 } 107 @Override 108 public boolean unloadTexture(BasicTexture texture) { 109 throw new UnsupportedOperationException(); 110 } 111 @Override 112 public void deleteBuffer(int bufferId) { 113 throw new UnsupportedOperationException(); 114 } 115 @Override 116 public void deleteRecycledResources() {} 117 @Override 118 public void multiplyMatrix(float[] mMatrix, int offset) {} 119 @Override 120 public void dumpStatisticsAndClear() {} 121 @Override 122 public void beginRenderTarget(RawTexture texture) {} 123 @Override 124 public void endRenderTarget() {} 125 @Override 126 public void drawMixed(BasicTexture from, int toColor, 127 float ratio, RectF src, RectF target) {} 128 129 @Override 130 public void setTextureParameters(BasicTexture texture) { 131 } 132 @Override 133 public void initializeTextureSize(BasicTexture texture, int format, int type) { 134 } 135 @Override 136 public void initializeTexture(BasicTexture texture, Bitmap bitmap) { 137 } 138 @Override 139 public void texSubImage2D(BasicTexture texture, int xOffset, int yOffset, Bitmap bitmap, 140 int format, int type) { 141 } 142 @Override 143 public int uploadBuffer(ByteBuffer buffer) { 144 return 0; 145 } 146 @Override 147 public int uploadBuffer(FloatBuffer buffer) { 148 return 0; 149 } 150 @Override 151 public void recoverFromLightCycle() { 152 } 153 @Override 154 public void getBounds(Rect bounds, int x, int y, int width, int height) { 155 } 156 @Override 157 public GLId getGLId() { 158 return null; 159 } 160 } 161