OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chromoting; | 5 package org.chromium.chromoting; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.graphics.BitmapFactory; | 9 import android.graphics.BitmapFactory; |
10 import android.graphics.PointF; | 10 import android.graphics.PointF; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 private static final String[] SKYBOX_IMAGE_NAMES = new String[] { | 176 private static final String[] SKYBOX_IMAGE_NAMES = new String[] { |
177 "skybox_left", "skybox_right", "skybox_bottom", "skybox_top", "skybox_ba ck", "skybox_front" | 177 "skybox_left", "skybox_right", "skybox_bottom", "skybox_top", "skybox_ba ck", "skybox_front" |
178 }; | 178 }; |
179 | 179 |
180 private final Activity mActivity; | 180 private final Activity mActivity; |
181 | 181 |
182 private float mHalfDesktopWidth; | 182 private float mHalfDesktopWidth; |
183 private float mCameraPosition; | 183 private float mCameraPosition; |
184 | 184 |
185 // Lock to allow multithreaded access to mCameraPosition. | 185 // Lock to allow multithreaded access to mCameraPosition. |
186 private Object mCameraPositionLock = new Object(); | 186 private final Object mCameraPositionLock = new Object(); |
mikecase (-- gone --)
2015/08/19 23:15:08
fyi, for lambroslambrou@chromium.org. I synced and
Lambros
2015/08/19 23:42:02
Sorry for the noise - we're actively working on th
| |
187 | 187 |
188 private float[] mCameraMatrix; | 188 private float[] mCameraMatrix; |
189 private float[] mViewMatrix; | 189 private float[] mViewMatrix; |
190 private float[] mProjectionMatrix; | 190 private float[] mProjectionMatrix; |
191 | 191 |
192 // Make matrix member variable to avoid unnecessary initialization. | 192 // Make matrix member variable to avoid unnecessary initialization. |
193 private float[] mDesktopModelMatrix; | 193 private float[] mDesktopModelMatrix; |
194 private float[] mDesktopCombinedMatrix; | 194 private float[] mDesktopCombinedMatrix; |
195 private float[] mEyePointModelMatrix; | 195 private float[] mEyePointModelMatrix; |
196 private float[] mEyePointCombinedMatrix; | 196 private float[] mEyePointCombinedMatrix; |
(...skipping 24 matching lines...) Expand all Loading... | |
221 private int mSkyboxProgramHandle; | 221 private int mSkyboxProgramHandle; |
222 private int mSkyboxPositionHandle; | 222 private int mSkyboxPositionHandle; |
223 private int mSkyboxCombinedMatrixHandle; | 223 private int mSkyboxCombinedMatrixHandle; |
224 private int mSkyboxTextureUnitHandle; | 224 private int mSkyboxTextureUnitHandle; |
225 private int mSkyboxTextureDataHandle; | 225 private int mSkyboxTextureDataHandle; |
226 | 226 |
227 // Flag to indicate whether reload the desktop texture or not. | 227 // Flag to indicate whether reload the desktop texture or not. |
228 private boolean mReloadTexture; | 228 private boolean mReloadTexture; |
229 | 229 |
230 /** Lock to allow multithreaded access to mReloadTexture. */ | 230 /** Lock to allow multithreaded access to mReloadTexture. */ |
231 private Object mReloadTextureLock = new Object(); | 231 private final Object mReloadTextureLock = new Object(); |
232 | 232 |
233 // Lock for eye position related operations. | 233 // Lock for eye position related operations. |
234 // This protects access to mEyePositionVector as well as mDesktop{Height/Wid th}Pixels. | 234 // This protects access to mEyePositionVector as well as mDesktop{Height/Wid th}Pixels. |
235 private Object mEyePositionLock = new Object(); | 235 private final Object mEyePositionLock = new Object(); |
236 | 236 |
237 private int mDesktopHeightPixels; | 237 private int mDesktopHeightPixels; |
238 private int mDesktopWidthPixels; | 238 private int mDesktopWidthPixels; |
239 | 239 |
240 private FloatBuffer mDesktopCoordinates; | 240 private FloatBuffer mDesktopCoordinates; |
241 | 241 |
242 // Flag to signal that the skybox images are fully decoded and should be loa ded | 242 // Flag to signal that the skybox images are fully decoded and should be loa ded |
243 // into the OpenGL textures. | 243 // into the OpenGL textures. |
244 private boolean mLoadSkyboxImagesTexture; | 244 private boolean mLoadSkyboxImagesTexture; |
245 | 245 |
246 // Lock to allow multithreaded access to mLoadSkyboxImagesTexture. | 246 // Lock to allow multithreaded access to mLoadSkyboxImagesTexture. |
247 private Object mLoadSkyboxImagesTextureLock = new Object(); | 247 private final Object mLoadSkyboxImagesTextureLock = new Object(); |
248 | 248 |
249 private ChromotingDownloadManager mDownloadManager; | 249 private ChromotingDownloadManager mDownloadManager; |
250 | 250 |
251 public CardboardDesktopRenderer(Activity activity) { | 251 public CardboardDesktopRenderer(Activity activity) { |
252 mActivity = activity; | 252 mActivity = activity; |
253 mReloadTexture = false; | 253 mReloadTexture = false; |
254 mCameraPosition = 0.0f; | 254 mCameraPosition = 0.0f; |
255 | 255 |
256 mCameraMatrix = new float[16]; | 256 mCameraMatrix = new float[16]; |
257 mViewMatrix = new float[16]; | 257 mViewMatrix = new float[16]; |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
752 image.recycle(); | 752 image.recycle(); |
753 } | 753 } |
754 } | 754 } |
755 | 755 |
756 /** | 756 /** |
757 * Exception when BitmapFactory fails to decode file. | 757 * Exception when BitmapFactory fails to decode file. |
758 */ | 758 */ |
759 private static class DecodeFileException extends Exception { | 759 private static class DecodeFileException extends Exception { |
760 } | 760 } |
761 } | 761 } |
OLD | NEW |