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/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 312 |
313 did_post_swapbuffers_ = false; | 313 did_post_swapbuffers_ = false; |
314 host_->Composite(frame_time); | 314 host_->Composite(frame_time); |
315 if (did_post_swapbuffers_) | 315 if (did_post_swapbuffers_) |
316 pending_swapbuffers_++; | 316 pending_swapbuffers_++; |
317 | 317 |
318 // Need to track vsync to avoid compositing more than once per frame. | 318 // Need to track vsync to avoid compositing more than once per frame. |
319 root_window_->RequestVSyncUpdate(); | 319 root_window_->RequestVSyncUpdate(); |
320 } | 320 } |
321 | 321 |
322 UIResourceProvider& CompositorImpl::GetUIResourceProvider() { | 322 ui::UIResourceProvider& CompositorImpl::GetUIResourceProvider() { |
323 return ui_resource_provider_; | 323 return ui_resource_provider_; |
324 } | 324 } |
325 | 325 |
326 ui::ResourceManager& CompositorImpl::GetResourceManager() { | 326 ui::ResourceManager& CompositorImpl::GetResourceManager() { |
327 return resource_manager_; | 327 return resource_manager_; |
328 } | 328 } |
329 | 329 |
330 ui::SystemUIResourceManager& CompositorImpl::GetSystemUIResourceManager() { | |
331 return ui_resource_provider_.GetSystemUIResourceManager(); | |
332 } | |
333 | |
334 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { | 330 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { |
335 if (subroot_layer_.get()) { | 331 if (subroot_layer_.get()) { |
336 subroot_layer_->RemoveFromParent(); | 332 subroot_layer_->RemoveFromParent(); |
337 subroot_layer_ = NULL; | 333 subroot_layer_ = NULL; |
338 } | 334 } |
339 if (root_layer.get()) { | 335 if (root_layer.get()) { |
340 subroot_layer_ = root_layer; | 336 subroot_layer_ = root_layer; |
341 root_layer_->AddChild(root_layer); | 337 root_layer_->AddChild(root_layer); |
342 } | 338 } |
343 } | 339 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 } | 676 } |
681 | 677 |
682 void CompositorImpl::SetNeedsAnimate() { | 678 void CompositorImpl::SetNeedsAnimate() { |
683 if (!host_) | 679 if (!host_) |
684 return; | 680 return; |
685 | 681 |
686 host_->SetNeedsAnimate(); | 682 host_->SetNeedsAnimate(); |
687 } | 683 } |
688 | 684 |
689 } // namespace content | 685 } // namespace content |
OLD | NEW |