| 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.cardboard; | 5 package org.chromium.chromoting.cardboard; |
| 6 | 6 |
| 7 import static org.chromium.chromoting.cardboard.CardboardUtil.makeFloatBuffer; | 7 import static org.chromium.chromoting.cardboard.CardboardUtil.makeFloatBuffer; |
| 8 import static org.chromium.chromoting.cardboard.CardboardUtil.makeRectangularTex
tureBuffer; | 8 import static org.chromium.chromoting.cardboard.CardboardUtil.makeRectangularTex
tureBuffer; |
| 9 | 9 |
| 10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 * so that both eyes will have the same texture. | 216 * so that both eyes will have the same texture. |
| 217 */ | 217 */ |
| 218 public void maybeLoadDesktopTexture() { | 218 public void maybeLoadDesktopTexture() { |
| 219 synchronized (mReloadTextureLock) { | 219 synchronized (mReloadTextureLock) { |
| 220 if (!mReloadTexture) { | 220 if (!mReloadTexture) { |
| 221 return; | 221 return; |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 // TODO(shichengfeng): Record the time desktop drawing takes. | 225 // TODO(shichengfeng): Record the time desktop drawing takes. |
| 226 Bitmap bitmap = mClient.getVideoFrame(); | 226 Bitmap bitmap = mClient.getDisplay().getVideoFrame(); |
| 227 | 227 |
| 228 if (bitmap == null) { | 228 if (bitmap == null) { |
| 229 // This can happen if the client is connected, but a complete video
frame has not yet | 229 // This can happen if the client is connected, but a complete video
frame has not yet |
| 230 // been decoded. | 230 // been decoded. |
| 231 return; | 231 return; |
| 232 } | 232 } |
| 233 | 233 |
| 234 updateVideoFrame(bitmap); | 234 updateVideoFrame(bitmap); |
| 235 | 235 |
| 236 synchronized (mReloadTextureLock) { | 236 synchronized (mReloadTextureLock) { |
| 237 mReloadTexture = false; | 237 mReloadTexture = false; |
| 238 } | 238 } |
| 239 } | 239 } |
| 240 | 240 |
| 241 /** | 241 /** |
| 242 * Inform this object that a new video frame should be rendered. | 242 * Inform this object that a new video frame should be rendered. |
| 243 * Called from native display thread. | 243 * Called from native display thread. |
| 244 */ | 244 */ |
| 245 public void reloadTexture() { | 245 public void reloadTexture() { |
| 246 synchronized (mReloadTextureLock) { | 246 synchronized (mReloadTextureLock) { |
| 247 mReloadTexture = true; | 247 mReloadTexture = true; |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 } | 250 } |
| OLD | NEW |