| 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 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 client_(client), | 122 client_(client), |
| 123 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 123 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 124 DCHECK(client); | 124 DCHECK(client); |
| 125 } | 125 } |
| 126 | 126 |
| 127 CompositorImpl::~CompositorImpl() { | 127 CompositorImpl::~CompositorImpl() { |
| 128 } | 128 } |
| 129 | 129 |
| 130 void CompositorImpl::Composite() { | 130 void CompositorImpl::Composite() { |
| 131 if (host_.get()) | 131 if (host_.get()) |
| 132 host_->Composite(); | 132 host_->Composite(base::TimeTicks::Now()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { | 135 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { |
| 136 root_layer_->RemoveAllChildren(); | 136 root_layer_->RemoveAllChildren(); |
| 137 root_layer_->AddChild(root_layer); | 137 root_layer_->AddChild(root_layer); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void CompositorImpl::SetWindowSurface(ANativeWindow* window) { | 140 void CompositorImpl::SetWindowSurface(ANativeWindow* window) { |
| 141 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); | 141 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); |
| 142 | 142 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 478 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 479 return GL_UNSIGNED_BYTE; | 479 return GL_UNSIGNED_BYTE; |
| 480 break; | 480 break; |
| 481 case ANDROID_BITMAP_FORMAT_RGB_565: | 481 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 482 default: | 482 default: |
| 483 return GL_UNSIGNED_SHORT_5_6_5; | 483 return GL_UNSIGNED_SHORT_5_6_5; |
| 484 } | 484 } |
| 485 } | 485 } |
| 486 | 486 |
| 487 } // namespace content | 487 } // namespace content |
| OLD | NEW |