• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
setSize(int width, int height)36     public void setSize(int width, int height) {}
37     @Override
clearBuffer()38     public void clearBuffer() {}
39     @Override
clearBuffer(float[] argb)40     public void clearBuffer(float[] argb) {}
setCurrentAnimationTimeMillis(long time)41     public void setCurrentAnimationTimeMillis(long time) {}
currentAnimationTimeMillis()42     public long currentAnimationTimeMillis() {
43         throw new UnsupportedOperationException();
44     }
45     @Override
setAlpha(float alpha)46     public void setAlpha(float alpha) {}
47     @Override
getAlpha()48     public float getAlpha() {
49         throw new UnsupportedOperationException();
50     }
51     @Override
multiplyAlpha(float alpha)52     public void multiplyAlpha(float alpha) {}
53     @Override
translate(float x, float y, float z)54     public void translate(float x, float y, float z) {}
55     @Override
translate(float x, float y)56     public void translate(float x, float y) {}
57     @Override
scale(float sx, float sy, float sz)58     public void scale(float sx, float sy, float sz) {}
59     @Override
rotate(float angle, float x, float y, float z)60     public void rotate(float angle, float x, float y, float z) {}
clipRect(int left, int top, int right, int bottom)61     public boolean clipRect(int left, int top, int right, int bottom) {
62         throw new UnsupportedOperationException();
63     }
64     @Override
save()65     public void save() {
66         throw new UnsupportedOperationException();
67     }
68     @Override
save(int saveFlags)69     public void save(int saveFlags) {
70         throw new UnsupportedOperationException();
71     }
setBlendEnabled(boolean enabled)72     public void setBlendEnabled(boolean enabled) {}
73     @Override
restore()74     public void restore() {}
75     @Override
drawLine(float x1, float y1, float x2, float y2, GLPaint paint)76     public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint) {}
77     @Override
drawRect(float x1, float y1, float x2, float y2, GLPaint paint)78     public void drawRect(float x1, float y1, float x2, float y2, GLPaint paint) {}
79     @Override
fillRect(float x, float y, float width, float height, int color)80     public void fillRect(float x, float y, float width, float height, int color) {}
81     @Override
drawTexture( BasicTexture texture, int x, int y, int width, int height)82     public void drawTexture(
83             BasicTexture texture, int x, int y, int width, int height) {}
84     @Override
drawMesh(BasicTexture tex, int x, int y, int xyBuffer, int uvBuffer, int indexBuffer, int indexCount)85     public void drawMesh(BasicTexture tex, int x, int y, int xyBuffer,
86             int uvBuffer, int indexBuffer, int indexCount) {}
drawTexture(BasicTexture texture, int x, int y, int width, int height, float alpha)87     public void drawTexture(BasicTexture texture,
88             int x, int y, int width, int height, float alpha) {}
89     @Override
drawTexture(BasicTexture texture, RectF source, RectF target)90     public void drawTexture(BasicTexture texture, RectF source, RectF target) {}
91     @Override
drawTexture(BasicTexture texture, float[] mTextureTransform, int x, int y, int w, int h)92     public void drawTexture(BasicTexture texture, float[] mTextureTransform,
93             int x, int y, int w, int h) {}
drawMixed(BasicTexture from, BasicTexture to, float ratio, 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
drawMixed(BasicTexture from, int to, float ratio, int x, int y, int w, int h)97     public void drawMixed(BasicTexture from, int to,
98             float ratio, int x, int y, int w, int h) {}
drawMixed(BasicTexture from, BasicTexture to, float ratio, int x, int y, int width, int height, float alpha)99     public void drawMixed(BasicTexture from, BasicTexture to,
100             float ratio, int x, int y, int width, int height, float alpha) {}
copyTexture(int x, int y, int width, int height)101     public BasicTexture copyTexture(int x, int y, int width, int height) {
102         throw new UnsupportedOperationException();
103     }
getGLInstance()104     public GL11 getGLInstance() {
105         throw new UnsupportedOperationException();
106     }
107     @Override
unloadTexture(BasicTexture texture)108     public boolean unloadTexture(BasicTexture texture) {
109         throw new UnsupportedOperationException();
110     }
111     @Override
deleteBuffer(int bufferId)112     public void deleteBuffer(int bufferId) {
113         throw new UnsupportedOperationException();
114     }
115     @Override
deleteRecycledResources()116     public void deleteRecycledResources() {}
117     @Override
multiplyMatrix(float[] mMatrix, int offset)118     public void multiplyMatrix(float[] mMatrix, int offset) {}
119     @Override
dumpStatisticsAndClear()120     public void dumpStatisticsAndClear() {}
121     @Override
beginRenderTarget(RawTexture texture)122     public void beginRenderTarget(RawTexture texture) {}
123     @Override
endRenderTarget()124     public void endRenderTarget() {}
125     @Override
drawMixed(BasicTexture from, int toColor, float ratio, RectF src, RectF target)126     public void drawMixed(BasicTexture from, int toColor,
127             float ratio, RectF src, RectF target) {}
128 
129     @Override
setTextureParameters(BasicTexture texture)130     public void setTextureParameters(BasicTexture texture) {
131     }
132     @Override
initializeTextureSize(BasicTexture texture, int format, int type)133     public void initializeTextureSize(BasicTexture texture, int format, int type) {
134     }
135     @Override
initializeTexture(BasicTexture texture, Bitmap bitmap)136     public void initializeTexture(BasicTexture texture, Bitmap bitmap) {
137     }
138     @Override
texSubImage2D(BasicTexture texture, int xOffset, int yOffset, Bitmap bitmap, int format, int type)139     public void texSubImage2D(BasicTexture texture, int xOffset, int yOffset, Bitmap bitmap,
140             int format, int type) {
141     }
142     @Override
uploadBuffer(ByteBuffer buffer)143     public int uploadBuffer(ByteBuffer buffer) {
144         return 0;
145     }
146     @Override
uploadBuffer(FloatBuffer buffer)147     public int uploadBuffer(FloatBuffer buffer) {
148         return 0;
149     }
150     @Override
recoverFromLightCycle()151     public void recoverFromLightCycle() {
152     }
153     @Override
getBounds(Rect bounds, int x, int y, int width, int height)154     public void getBounds(Rect bounds, int x, int y, int width, int height) {
155     }
156     @Override
getGLId()157     public GLId getGLId() {
158         return null;
159     }
160 }
161