| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 host_ = cc::LayerTreeHost::create(this, settings, impl_thread.Pass()); | 189 host_ = cc::LayerTreeHost::create(this, settings, impl_thread.Pass()); |
| 190 host_->setRootLayer(root_layer_); | 190 host_->setRootLayer(root_layer_); |
| 191 | 191 |
| 192 host_->setVisible(true); | 192 host_->setVisible(true); |
| 193 host_->setSurfaceReady(); | 193 host_->setSurfaceReady(); |
| 194 host_->setViewportSize(size_, size_); | 194 host_->setViewportSize(size_, size_); |
| 195 host_->setHasTransparentBackground(has_transparent_background_); | 195 host_->setHasTransparentBackground(has_transparent_background_); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 void CompositorImpl::setDeviceScaleFactor(float factor) { |
| 200 host_->setDeviceScaleFactor(factor); |
| 201 } |
| 202 |
| 199 void CompositorImpl::SetWindowBounds(const gfx::Size& size) { | 203 void CompositorImpl::SetWindowBounds(const gfx::Size& size) { |
| 200 if (size_ == size) | 204 if (size_ == size) |
| 201 return; | 205 return; |
| 202 | 206 |
| 203 size_ = size; | 207 size_ = size; |
| 204 if (host_) | 208 if (host_) |
| 205 host_->setViewportSize(size, size); | 209 host_->setViewportSize(size, size); |
| 206 root_layer_->setBounds(size); | 210 root_layer_->setBounds(size); |
| 207 } | 211 } |
| 208 | 212 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 428 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 425 return GL_UNSIGNED_BYTE; | 429 return GL_UNSIGNED_BYTE; |
| 426 break; | 430 break; |
| 427 case ANDROID_BITMAP_FORMAT_RGB_565: | 431 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 428 default: | 432 default: |
| 429 return GL_UNSIGNED_SHORT_5_6_5; | 433 return GL_UNSIGNED_SHORT_5_6_5; |
| 430 } | 434 } |
| 431 } | 435 } |
| 432 | 436 |
| 433 } // namespace content | 437 } // namespace content |
| OLD | NEW |