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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 root_layer_(cc::Layer::Create()), | 85 root_layer_(cc::Layer::Create()), |
86 resource_collection_(new cc::DelegatedFrameResourceCollection), | 86 resource_collection_(new cc::DelegatedFrameResourceCollection), |
87 output_surface_(NULL) { | 87 output_surface_(NULL) { |
88 DCHECK(last_egl_context_); | 88 DCHECK(last_egl_context_); |
89 | 89 |
90 resource_collection_->SetClient(this); | 90 resource_collection_->SetClient(this); |
91 | 91 |
92 cc::LayerTreeSettings settings; | 92 cc::LayerTreeSettings settings; |
93 | 93 |
94 // Should be kept in sync with compositor_impl_android.cc. | 94 // Should be kept in sync with compositor_impl_android.cc. |
95 settings.allow_antialiasing = false; | 95 settings.renderer_settings.allow_antialiasing = false; |
96 settings.highp_threshold_min = 2048; | 96 settings.renderer_settings.highp_threshold_min = 2048; |
97 | 97 |
98 // Webview does not own the surface so should not clear it. | 98 // Webview does not own the surface so should not clear it. |
99 settings.should_clear_root_render_pass = false; | 99 settings.renderer_settings.should_clear_root_render_pass = false; |
100 | 100 |
101 // TODO(enne): Update this this compositor to use a synchronous scheduler. | 101 // TODO(enne): Update this this compositor to use a synchronous scheduler. |
102 settings.single_thread_proxy_scheduler = false; | 102 settings.single_thread_proxy_scheduler = false; |
103 | 103 |
104 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded( | 104 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded( |
105 this, this, nullptr, nullptr, settings, nullptr, nullptr); | 105 this, this, nullptr, nullptr, settings, nullptr, nullptr); |
106 layer_tree_host_->SetRootLayer(root_layer_); | 106 layer_tree_host_->SetRootLayer(root_layer_); |
107 layer_tree_host_->SetLayerTreeHostClientReady(); | 107 layer_tree_host_->SetLayerTreeHostClientReady(); |
108 layer_tree_host_->set_has_transparent_background(true); | 108 layer_tree_host_->set_has_transparent_background(true); |
109 } | 109 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 void HardwareRenderer::UnusedResourcesAreAvailable() { | 267 void HardwareRenderer::UnusedResourcesAreAvailable() { |
268 cc::ReturnedResourceArray returned_resources; | 268 cc::ReturnedResourceArray returned_resources; |
269 resource_collection_->TakeUnusedResourcesForChildCompositor( | 269 resource_collection_->TakeUnusedResourcesForChildCompositor( |
270 &returned_resources); | 270 &returned_resources); |
271 shared_renderer_state_->InsertReturnedResourcesOnRT(returned_resources); | 271 shared_renderer_state_->InsertReturnedResourcesOnRT(returned_resources); |
272 } | 272 } |
273 | 273 |
274 } // namespace android_webview | 274 } // namespace android_webview |
OLD | NEW |