| 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.makeShortBuffer; | 8 import static org.chromium.chromoting.cardboard.CardboardUtil.makeShortBuffer; |
| 9 | 9 |
| 10 import android.app.Activity; | 10 import android.app.Activity; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Number of drawing vertices passed to glDrawElements(). | 73 // Number of drawing vertices passed to glDrawElements(). |
| 74 private static final int NUM_DRAWING_VERTICES = ROWS * COLUMNS * NUM_DRAWING
_VERTICES_PER_RECT; | 74 private static final int NUM_DRAWING_VERTICES = ROWS * COLUMNS * NUM_DRAWING
_VERTICES_PER_RECT; |
| 75 | 75 |
| 76 // TODO(shichengfeng): Find a photosphere image and upload it. | 76 // TODO(shichengfeng): Find a photosphere image and upload it. |
| 77 private static final String IMAGE_URI = | 77 private static final String IMAGE_URI = |
| 78 "https://dl.google.com/chrome-remote-desktop/android-assets/photosph
ere.jpg"; | 78 "https://dl.google.com/chrome-remote-desktop/android-assets/photosph
ere.jpg"; |
| 79 private static final String IMAGE_NAME = "photosphere"; | 79 private static final String IMAGE_NAME = "photosphere"; |
| 80 | 80 |
| 81 private static final ShortBuffer INDICES_BUFFER = calculateIndicesBuffer(); | 81 private static final ShortBuffer INDICES_BUFFER = calculateIndicesBuffer(); |
| 82 | 82 |
| 83 // Maxiumum resolution for decoded image. | 83 // Maximum resolution for decoded image. |
| 84 private static final int MAX_WIDTH = 4096; | 84 private static final int MAX_WIDTH = 4096; |
| 85 private static final int MAX_HEIGHT = 4096; | 85 private static final int MAX_HEIGHT = 4096; |
| 86 | 86 |
| 87 private FloatBuffer mPositionBuffer; | 87 private FloatBuffer mPositionBuffer; |
| 88 private FloatBuffer mTextureCoordinatesBuffer; | 88 private FloatBuffer mTextureCoordinatesBuffer; |
| 89 | 89 |
| 90 private Activity mActivity; | 90 private Activity mActivity; |
| 91 | 91 |
| 92 private String mDownloadDirectory; | 92 private String mDownloadDirectory; |
| 93 | 93 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 while (height > MAX_HEIGHT || width > MAX_WIDTH) { | 305 while (height > MAX_HEIGHT || width > MAX_WIDTH) { |
| 306 inSampleSize *= 2; | 306 inSampleSize *= 2; |
| 307 height /= 2; | 307 height /= 2; |
| 308 width /= 2; | 308 width /= 2; |
| 309 } | 309 } |
| 310 | 310 |
| 311 options.inSampleSize = inSampleSize; | 311 options.inSampleSize = inSampleSize; |
| 312 } | 312 } |
| 313 } | 313 } |
| OLD | NEW |