| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/surfaces_instance.h" | 5 #include "android_webview/browser/surfaces_instance.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_gl_surface.h" | 10 #include "android_webview/browser/aw_gl_surface.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Should be kept in sync with compositor_impl_android.cc. | 45 // Should be kept in sync with compositor_impl_android.cc. |
| 46 settings.allow_antialiasing = false; | 46 settings.allow_antialiasing = false; |
| 47 settings.highp_threshold_min = 2048; | 47 settings.highp_threshold_min = 2048; |
| 48 | 48 |
| 49 // Webview does not own the surface so should not clear it. | 49 // Webview does not own the surface so should not clear it. |
| 50 settings.should_clear_root_render_pass = false; | 50 settings.should_clear_root_render_pass = false; |
| 51 | 51 |
| 52 surface_manager_.reset(new cc::SurfaceManager); | 52 surface_manager_.reset(new cc::SurfaceManager); |
| 53 surface_id_allocator_.reset(new cc::SurfaceIdAllocator()); | 53 surface_id_allocator_.reset(new cc::SurfaceIdAllocator()); |
| 54 |
| 55 constexpr bool is_root = true; |
| 56 constexpr bool handles_frame_sink_id_invalidation = true; |
| 57 constexpr bool needs_sync_points = true; |
| 54 support_.reset(new cc::CompositorFrameSinkSupport( | 58 support_.reset(new cc::CompositorFrameSinkSupport( |
| 55 this, surface_manager_.get(), frame_sink_id_, | 59 this, surface_manager_.get(), frame_sink_id_, is_root, |
| 56 true /* submits_to_display_compositor */)); | 60 handles_frame_sink_id_invalidation, needs_sync_points)); |
| 57 | 61 |
| 58 begin_frame_source_.reset(new cc::StubBeginFrameSource); | 62 begin_frame_source_.reset(new cc::StubBeginFrameSource); |
| 59 std::unique_ptr<cc::TextureMailboxDeleter> texture_mailbox_deleter( | 63 std::unique_ptr<cc::TextureMailboxDeleter> texture_mailbox_deleter( |
| 60 new cc::TextureMailboxDeleter(nullptr)); | 64 new cc::TextureMailboxDeleter(nullptr)); |
| 61 std::unique_ptr<ParentOutputSurface> output_surface_holder( | 65 std::unique_ptr<ParentOutputSurface> output_surface_holder( |
| 62 new ParentOutputSurface(AwRenderThreadContextProvider::Create( | 66 new ParentOutputSurface(AwRenderThreadContextProvider::Create( |
| 63 make_scoped_refptr(new AwGLSurface), | 67 make_scoped_refptr(new AwGLSurface), |
| 64 DeferredGpuCommandService::GetInstance()))); | 68 DeferredGpuCommandService::GetInstance()))); |
| 65 output_surface_ = output_surface_holder.get(); | 69 output_surface_ = output_surface_holder.get(); |
| 66 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( | 70 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 170 |
| 167 void SurfacesInstance::WillDrawSurface() {} | 171 void SurfacesInstance::WillDrawSurface() {} |
| 168 | 172 |
| 169 void SurfacesInstance::ReclaimResources( | 173 void SurfacesInstance::ReclaimResources( |
| 170 const cc::ReturnedResourceArray& resources) { | 174 const cc::ReturnedResourceArray& resources) { |
| 171 // Root surface should have no resources to return. | 175 // Root surface should have no resources to return. |
| 172 CHECK(resources.empty()); | 176 CHECK(resources.empty()); |
| 173 } | 177 } |
| 174 | 178 |
| 175 } // namespace android_webview | 179 } // namespace android_webview |
| OLD | NEW |