OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "android_webview/browser/hardware_renderer.h" | 5 #include "android_webview/browser/hardware_renderer.h" |
6 | 6 |
7 #include "android_webview/browser/aw_gl_surface.h" | 7 #include "android_webview/browser/aw_gl_surface.h" |
8 #include "android_webview/browser/aw_render_thread_context_provider.h" | 8 #include "android_webview/browser/aw_render_thread_context_provider.h" |
9 #include "android_webview/browser/child_frame.h" | 9 #include "android_webview/browser/child_frame.h" |
10 #include "android_webview/browser/deferred_gpu_command_service.h" | 10 #include "android_webview/browser/deferred_gpu_command_service.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Should be kept in sync with compositor_impl_android.cc. | 51 // Should be kept in sync with compositor_impl_android.cc. |
52 settings.renderer_settings.allow_antialiasing = false; | 52 settings.renderer_settings.allow_antialiasing = false; |
53 settings.renderer_settings.highp_threshold_min = 2048; | 53 settings.renderer_settings.highp_threshold_min = 2048; |
54 | 54 |
55 // Webview does not own the surface so should not clear it. | 55 // Webview does not own the surface so should not clear it. |
56 settings.renderer_settings.should_clear_root_render_pass = false; | 56 settings.renderer_settings.should_clear_root_render_pass = false; |
57 | 57 |
58 // TODO(enne): Update this this compositor to use a synchronous scheduler. | 58 // TODO(enne): Update this this compositor to use a synchronous scheduler. |
59 settings.single_thread_proxy_scheduler = false; | 59 settings.single_thread_proxy_scheduler = false; |
60 | 60 |
61 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded( | 61 cc::LayerTreeHost::InitParams params; |
62 this, this, nullptr, nullptr, nullptr, settings, nullptr, nullptr); | 62 params.client = this; |
| 63 params.settings = settings; |
| 64 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
63 layer_tree_host_->SetRootLayer(root_layer_); | 65 layer_tree_host_->SetRootLayer(root_layer_); |
64 layer_tree_host_->SetLayerTreeHostClientReady(); | 66 layer_tree_host_->SetLayerTreeHostClientReady(); |
65 layer_tree_host_->set_has_transparent_background(true); | 67 layer_tree_host_->set_has_transparent_background(true); |
66 } | 68 } |
67 | 69 |
68 HardwareRenderer::~HardwareRenderer() { | 70 HardwareRenderer::~HardwareRenderer() { |
69 // Must reset everything before |resource_collection_| to ensure all | 71 // Must reset everything before |resource_collection_| to ensure all |
70 // resources are returned before resetting |resource_collection_| client. | 72 // resources are returned before resetting |resource_collection_| client. |
71 layer_tree_host_.reset(); | 73 layer_tree_host_.reset(); |
72 root_layer_ = NULL; | 74 root_layer_ = NULL; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 210 } |
209 | 211 |
210 void HardwareRenderer::UnusedResourcesAreAvailable() { | 212 void HardwareRenderer::UnusedResourcesAreAvailable() { |
211 cc::ReturnedResourceArray returned_resources; | 213 cc::ReturnedResourceArray returned_resources; |
212 resource_collection_->TakeUnusedResourcesForChildCompositor( | 214 resource_collection_->TakeUnusedResourcesForChildCompositor( |
213 &returned_resources); | 215 &returned_resources); |
214 shared_renderer_state_->InsertReturnedResourcesOnRT(returned_resources); | 216 shared_renderer_state_->InsertReturnedResourcesOnRT(returned_resources); |
215 } | 217 } |
216 | 218 |
217 } // namespace android_webview | 219 } // namespace android_webview |
OLD | NEW |