Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: android_webview/browser/surfaces_instance.cc

Issue 2304483002: Revert of Make cc::Display not own its BeginFrameSource (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "android_webview/browser/aw_render_thread_context_provider.h" 11 #include "android_webview/browser/aw_render_thread_context_provider.h"
12 #include "android_webview/browser/deferred_gpu_command_service.h" 12 #include "android_webview/browser/deferred_gpu_command_service.h"
13 #include "android_webview/browser/parent_output_surface.h" 13 #include "android_webview/browser/parent_output_surface.h"
14 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
15 #include "cc/output/renderer_settings.h" 15 #include "cc/output/renderer_settings.h"
16 #include "cc/output/texture_mailbox_deleter.h" 16 #include "cc/output/texture_mailbox_deleter.h"
17 #include "cc/quads/surface_draw_quad.h" 17 #include "cc/quads/surface_draw_quad.h"
18 #include "cc/scheduler/begin_frame_source.h"
18 #include "cc/surfaces/display.h" 19 #include "cc/surfaces/display.h"
19 #include "cc/surfaces/display_scheduler.h" 20 #include "cc/surfaces/display_scheduler.h"
20 #include "cc/surfaces/surface_factory.h" 21 #include "cc/surfaces/surface_factory.h"
21 #include "cc/surfaces/surface_id_allocator.h" 22 #include "cc/surfaces/surface_id_allocator.h"
22 #include "cc/surfaces/surface_manager.h" 23 #include "cc/surfaces/surface_manager.h"
23 #include "ui/gfx/geometry/rect.h" 24 #include "ui/gfx/geometry/rect.h"
24 #include "ui/gfx/geometry/size.h" 25 #include "ui/gfx/geometry/size.h"
25 #include "ui/gfx/transform.h" 26 #include "ui/gfx/transform.h"
26 27
27 namespace android_webview { 28 namespace android_webview {
(...skipping 18 matching lines...) Expand all
46 settings.highp_threshold_min = 2048; 47 settings.highp_threshold_min = 2048;
47 48
48 // Webview does not own the surface so should not clear it. 49 // Webview does not own the surface so should not clear it.
49 settings.should_clear_root_render_pass = false; 50 settings.should_clear_root_render_pass = false;
50 51
51 surface_manager_.reset(new cc::SurfaceManager); 52 surface_manager_.reset(new cc::SurfaceManager);
52 surface_id_allocator_.reset( 53 surface_id_allocator_.reset(
53 new cc::SurfaceIdAllocator(next_surface_client_id_++)); 54 new cc::SurfaceIdAllocator(next_surface_client_id_++));
54 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id()); 55 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
55 56
57 std::unique_ptr<cc::BeginFrameSource> begin_frame_source(
58 new cc::StubBeginFrameSource);
56 std::unique_ptr<cc::TextureMailboxDeleter> texture_mailbox_deleter( 59 std::unique_ptr<cc::TextureMailboxDeleter> texture_mailbox_deleter(
57 new cc::TextureMailboxDeleter(nullptr)); 60 new cc::TextureMailboxDeleter(nullptr));
58 std::unique_ptr<ParentOutputSurface> output_surface_holder( 61 std::unique_ptr<ParentOutputSurface> output_surface_holder(
59 new ParentOutputSurface(AwRenderThreadContextProvider::Create( 62 new ParentOutputSurface(AwRenderThreadContextProvider::Create(
60 gl_surface_, DeferredGpuCommandService::GetInstance()))); 63 gl_surface_, DeferredGpuCommandService::GetInstance())));
61 output_surface_ = output_surface_holder.get(); 64 output_surface_ = output_surface_holder.get();
62 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( 65 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler(
63 &begin_frame_source_, nullptr, 66 begin_frame_source.get(), nullptr,
64 output_surface_holder->capabilities().max_frames_pending)); 67 output_surface_holder->capabilities().max_frames_pending));
65 display_.reset(new cc::Display( 68 display_.reset(new cc::Display(
66 nullptr /* shared_bitmap_manager */, 69 nullptr /* shared_bitmap_manager */,
67 nullptr /* gpu_memory_buffer_manager */, settings, 70 nullptr /* gpu_memory_buffer_manager */, settings,
68 &begin_frame_source_, std::move(output_surface_holder), 71 std::move(begin_frame_source), std::move(output_surface_holder),
69 std::move(scheduler), std::move(texture_mailbox_deleter))); 72 std::move(scheduler), std::move(texture_mailbox_deleter)));
70 display_->Initialize(this, surface_manager_.get(), 73 display_->Initialize(this, surface_manager_.get(),
71 surface_id_allocator_->client_id()); 74 surface_id_allocator_->client_id());
72 display_->SetVisible(true); 75 display_->SetVisible(true);
73 76
74 surface_factory_.reset(new cc::SurfaceFactory(surface_manager_.get(), this)); 77 surface_factory_.reset(new cc::SurfaceFactory(surface_manager_.get(), this));
75 78
76 DCHECK(!g_surfaces_instance); 79 DCHECK(!g_surfaces_instance);
77 g_surfaces_instance = this; 80 g_surfaces_instance = this;
78 81
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 CHECK(resources.empty()); 185 CHECK(resources.empty());
183 } 186 }
184 187
185 void SurfacesInstance::SetBeginFrameSource( 188 void SurfacesInstance::SetBeginFrameSource(
186 cc::BeginFrameSource* begin_frame_source) { 189 cc::BeginFrameSource* begin_frame_source) {
187 // Parent compsitor calls DrawAndSwap directly and doesn't use 190 // Parent compsitor calls DrawAndSwap directly and doesn't use
188 // BeginFrameSource. 191 // BeginFrameSource.
189 } 192 }
190 193
191 } // namespace android_webview 194 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/surfaces_instance.h ('k') | blimp/client/app/compositor/browser_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698