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/deferred_gpu_command_service.h" | 8 #include "android_webview/browser/deferred_gpu_command_service.h" |
9 #include "android_webview/browser/parent_output_surface.h" | 9 #include "android_webview/browser/parent_output_surface.h" |
10 #include "android_webview/browser/shared_renderer_state.h" | 10 #include "android_webview/browser/shared_renderer_state.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 cc::LayerTreeSettings settings; | 90 cc::LayerTreeSettings settings; |
91 | 91 |
92 // Should be kept in sync with compositor_impl_android.cc. | 92 // Should be kept in sync with compositor_impl_android.cc. |
93 settings.allow_antialiasing = false; | 93 settings.allow_antialiasing = false; |
94 settings.highp_threshold_min = 2048; | 94 settings.highp_threshold_min = 2048; |
95 | 95 |
96 // Webview does not own the surface so should not clear it. | 96 // Webview does not own the surface so should not clear it. |
97 settings.should_clear_root_render_pass = false; | 97 settings.should_clear_root_render_pass = false; |
98 | 98 |
| 99 // TODO(enne): Update this this compositor to use a synchronous scheduler. |
| 100 settings.single_thread_proxy_scheduler = false; |
| 101 |
99 layer_tree_host_ = | 102 layer_tree_host_ = |
100 cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings, NULL); | 103 cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings, NULL); |
101 layer_tree_host_->SetRootLayer(root_layer_); | 104 layer_tree_host_->SetRootLayer(root_layer_); |
102 layer_tree_host_->SetLayerTreeHostClientReady(); | 105 layer_tree_host_->SetLayerTreeHostClientReady(); |
103 layer_tree_host_->set_has_transparent_background(true); | 106 layer_tree_host_->set_has_transparent_background(true); |
104 } | 107 } |
105 | 108 |
106 HardwareRenderer::~HardwareRenderer() { | 109 HardwareRenderer::~HardwareRenderer() { |
107 // Must reset everything before |resource_collection_| to ensure all | 110 // Must reset everything before |resource_collection_| to ensure all |
108 // resources are returned before resetting |resource_collection_| client. | 111 // resources are returned before resetting |resource_collection_| client. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 251 } |
249 | 252 |
250 void HardwareRenderer::UnusedResourcesAreAvailable() { | 253 void HardwareRenderer::UnusedResourcesAreAvailable() { |
251 cc::ReturnedResourceArray returned_resources; | 254 cc::ReturnedResourceArray returned_resources; |
252 resource_collection_->TakeUnusedResourcesForChildCompositor( | 255 resource_collection_->TakeUnusedResourcesForChildCompositor( |
253 &returned_resources); | 256 &returned_resources); |
254 shared_renderer_state_->InsertReturnedResources(returned_resources); | 257 shared_renderer_state_->InsertReturnedResources(returned_resources); |
255 } | 258 } |
256 | 259 |
257 } // namespace android_webview | 260 } // namespace android_webview |
OLD | NEW |