Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 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 | |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 19 | import android.graphics.Bitmap; |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 20 | import android.graphics.RectF; |
| 21 | |
George Mount | 6eb3376 | 2012-11-16 15:44:26 -0800 | [diff] [blame^] | 22 | import java.nio.ByteBuffer; |
| 23 | import java.nio.FloatBuffer; |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 24 | |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 25 | import javax.microedition.khronos.opengles.GL11; |
| 26 | |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 27 | public class GLCanvasStub extends GLCanvas { |
| 28 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 29 | public void setSize(int width, int height) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 30 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 31 | public void clearBuffer() {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 32 | @Override |
Bobby Georgescu | 915c2c5 | 2012-08-23 13:05:53 -0700 | [diff] [blame] | 33 | public void clearBuffer(float[] argb) {} |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 34 | public void setCurrentAnimationTimeMillis(long time) {} |
| 35 | public long currentAnimationTimeMillis() { |
| 36 | throw new UnsupportedOperationException(); |
| 37 | } |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 38 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 39 | public void setAlpha(float alpha) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 40 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 41 | public float getAlpha() { |
| 42 | throw new UnsupportedOperationException(); |
| 43 | } |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 44 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 45 | public void multiplyAlpha(float alpha) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 46 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 47 | public void translate(float x, float y, float z) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 48 | @Override |
Chih-Chung Chang | 174cac8 | 2012-02-16 07:27:03 +0800 | [diff] [blame] | 49 | public void translate(float x, float y) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 50 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 51 | public void scale(float sx, float sy, float sz) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 52 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 53 | public void rotate(float angle, float x, float y, float z) {} |
| 54 | public boolean clipRect(int left, int top, int right, int bottom) { |
| 55 | throw new UnsupportedOperationException(); |
| 56 | } |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 57 | @Override |
Chih-Chung Chang | cfa105d | 2012-02-18 06:17:18 +0800 | [diff] [blame] | 58 | public void save() { |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 59 | throw new UnsupportedOperationException(); |
| 60 | } |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 61 | @Override |
Chih-Chung Chang | cfa105d | 2012-02-18 06:17:18 +0800 | [diff] [blame] | 62 | public void save(int saveFlags) { |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 63 | throw new UnsupportedOperationException(); |
| 64 | } |
| 65 | public void setBlendEnabled(boolean enabled) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 66 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 67 | public void restore() {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 68 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 69 | public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 70 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 71 | public void drawRect(float x1, float y1, float x2, float y2, GLPaint paint) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 72 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 73 | public void fillRect(float x, float y, float width, float height, int color) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 74 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 75 | public void drawTexture( |
| 76 | BasicTexture texture, int x, int y, int width, int height) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 77 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 78 | public void drawMesh(BasicTexture tex, int x, int y, int xyBuffer, |
| 79 | int uvBuffer, int indexBuffer, int indexCount) {} |
| 80 | public void drawTexture(BasicTexture texture, |
| 81 | int x, int y, int width, int height, float alpha) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 82 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 83 | public void drawTexture(BasicTexture texture, RectF source, RectF target) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 84 | @Override |
Chih-Chung Chang | b29a27f | 2012-03-22 17:42:33 +0800 | [diff] [blame] | 85 | public void drawTexture(BasicTexture texture, float[] mTextureTransform, |
| 86 | int x, int y, int w, int h) {} |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 87 | public void drawMixed(BasicTexture from, BasicTexture to, |
| 88 | float ratio, int x, int y, int w, int h) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 89 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 90 | public void drawMixed(BasicTexture from, int to, |
| 91 | float ratio, int x, int y, int w, int h) {} |
| 92 | public void drawMixed(BasicTexture from, BasicTexture to, |
| 93 | float ratio, int x, int y, int width, int height, float alpha) {} |
| 94 | public BasicTexture copyTexture(int x, int y, int width, int height) { |
| 95 | throw new UnsupportedOperationException(); |
| 96 | } |
| 97 | public GL11 getGLInstance() { |
| 98 | throw new UnsupportedOperationException(); |
| 99 | } |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 100 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 101 | public boolean unloadTexture(BasicTexture texture) { |
| 102 | throw new UnsupportedOperationException(); |
| 103 | } |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 104 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 105 | public void deleteBuffer(int bufferId) { |
| 106 | throw new UnsupportedOperationException(); |
| 107 | } |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 108 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 109 | public void deleteRecycledResources() {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 110 | @Override |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 111 | public void multiplyMatrix(float[] mMatrix, int offset) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 112 | @Override |
Chih-Chung Chang | 7b83fb8 | 2012-02-22 08:00:31 +0800 | [diff] [blame] | 113 | public void dumpStatisticsAndClear() {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 114 | @Override |
Owen Lin | 8ac2e86 | 2012-04-24 14:08:44 +0800 | [diff] [blame] | 115 | public void beginRenderTarget(RawTexture texture) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 116 | @Override |
Owen Lin | 8ac2e86 | 2012-04-24 14:08:44 +0800 | [diff] [blame] | 117 | public void endRenderTarget() {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 118 | @Override |
Owen Lin | a8f3473 | 2012-10-11 15:08:50 +0800 | [diff] [blame] | 119 | public void drawMixed(BasicTexture from, int toColor, |
| 120 | float ratio, RectF src, RectF target) {} |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 121 | |
| 122 | @Override |
| 123 | public void setTextureParameters(BasicTexture texture) { |
| 124 | } |
| 125 | @Override |
| 126 | public void initializeTextureSize(BasicTexture texture, int format, int type) { |
| 127 | } |
| 128 | @Override |
| 129 | public void initializeTexture(BasicTexture texture, Bitmap bitmap) { |
| 130 | } |
| 131 | @Override |
| 132 | public void texSubImage2D(BasicTexture texture, int xOffset, int yOffset, Bitmap bitmap, |
| 133 | int format, int type) { |
| 134 | } |
| 135 | @Override |
George Mount | 6eb3376 | 2012-11-16 15:44:26 -0800 | [diff] [blame^] | 136 | public int uploadBuffer(ByteBuffer buffer) { |
| 137 | return 0; |
| 138 | } |
| 139 | @Override |
| 140 | public int uploadBuffer(FloatBuffer buffer) { |
| 141 | return 0; |
George Mount | 7da54d7 | 2012-11-01 10:32:41 -0700 | [diff] [blame] | 142 | } |
| 143 | @Override |
| 144 | public void setBlending(Blending blending) { |
| 145 | } |
| 146 | @Override |
| 147 | public void enableStencil() { |
| 148 | } |
| 149 | @Override |
| 150 | public void disableStencil() { |
| 151 | } |
| 152 | @Override |
| 153 | public void clearStencilBuffer() { |
| 154 | } |
| 155 | @Override |
| 156 | public void updateStencil(boolean update) { |
| 157 | } |
| 158 | @Override |
| 159 | public void drawOnlyOutsideStencil(boolean onlyOutside) { |
| 160 | } |
George Mount | 6eb3376 | 2012-11-16 15:44:26 -0800 | [diff] [blame^] | 161 | @Override |
| 162 | public void initialize(GL11 gl) { |
| 163 | } |
Owen Lin | f9a0a43 | 2011-08-17 22:07:43 +0800 | [diff] [blame] | 164 | } |