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

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

Issue 2286273003: Make cc::Display not own its BeginFrameSource (Closed)
Patch Set: Fix webview 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"
19 #include "cc/surfaces/display.h" 18 #include "cc/surfaces/display.h"
20 #include "cc/surfaces/display_scheduler.h" 19 #include "cc/surfaces/display_scheduler.h"
21 #include "cc/surfaces/surface_factory.h" 20 #include "cc/surfaces/surface_factory.h"
22 #include "cc/surfaces/surface_id_allocator.h" 21 #include "cc/surfaces/surface_id_allocator.h"
23 #include "cc/surfaces/surface_manager.h" 22 #include "cc/surfaces/surface_manager.h"
24 #include "ui/gfx/geometry/rect.h" 23 #include "ui/gfx/geometry/rect.h"
25 #include "ui/gfx/geometry/size.h" 24 #include "ui/gfx/geometry/size.h"
26 #include "ui/gfx/transform.h" 25 #include "ui/gfx/transform.h"
27 26
28 namespace android_webview { 27 namespace android_webview {
(...skipping 18 matching lines...) Expand all
47 settings.highp_threshold_min = 2048; 46 settings.highp_threshold_min = 2048;
48 47
49 // Webview does not own the surface so should not clear it. 48 // Webview does not own the surface so should not clear it.
50 settings.should_clear_root_render_pass = false; 49 settings.should_clear_root_render_pass = false;
51 50
52 surface_manager_.reset(new cc::SurfaceManager); 51 surface_manager_.reset(new cc::SurfaceManager);
53 surface_id_allocator_.reset( 52 surface_id_allocator_.reset(
54 new cc::SurfaceIdAllocator(next_surface_client_id_++)); 53 new cc::SurfaceIdAllocator(next_surface_client_id_++));
55 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id()); 54 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
56 55
57 std::unique_ptr<cc::BeginFrameSource> begin_frame_source(
58 new cc::StubBeginFrameSource);
59 std::unique_ptr<cc::TextureMailboxDeleter> texture_mailbox_deleter( 56 std::unique_ptr<cc::TextureMailboxDeleter> texture_mailbox_deleter(
60 new cc::TextureMailboxDeleter(nullptr)); 57 new cc::TextureMailboxDeleter(nullptr));
61 std::unique_ptr<ParentOutputSurface> output_surface_holder( 58 std::unique_ptr<ParentOutputSurface> output_surface_holder(
62 new ParentOutputSurface(AwRenderThreadContextProvider::Create( 59 new ParentOutputSurface(AwRenderThreadContextProvider::Create(
63 gl_surface_, DeferredGpuCommandService::GetInstance()))); 60 gl_surface_, DeferredGpuCommandService::GetInstance())));
64 output_surface_ = output_surface_holder.get(); 61 output_surface_ = output_surface_holder.get();
65 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( 62 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler(
66 begin_frame_source.get(), nullptr, 63 &begin_frame_source_, nullptr,
67 output_surface_holder->capabilities().max_frames_pending)); 64 output_surface_holder->capabilities().max_frames_pending));
68 display_.reset(new cc::Display( 65 display_.reset(new cc::Display(
69 nullptr /* shared_bitmap_manager */, 66 nullptr /* shared_bitmap_manager */,
70 nullptr /* gpu_memory_buffer_manager */, settings, 67 nullptr /* gpu_memory_buffer_manager */, settings,
71 std::move(begin_frame_source), std::move(output_surface_holder), 68 &begin_frame_source_, std::move(output_surface_holder),
72 std::move(scheduler), std::move(texture_mailbox_deleter))); 69 std::move(scheduler), std::move(texture_mailbox_deleter)));
73 display_->Initialize(this, surface_manager_.get(), 70 display_->Initialize(this, surface_manager_.get(),
74 surface_id_allocator_->client_id()); 71 surface_id_allocator_->client_id());
75 display_->SetVisible(true); 72 display_->SetVisible(true);
76 73
77 surface_factory_.reset(new cc::SurfaceFactory(surface_manager_.get(), this)); 74 surface_factory_.reset(new cc::SurfaceFactory(surface_manager_.get(), this));
78 75
79 DCHECK(!g_surfaces_instance); 76 DCHECK(!g_surfaces_instance);
80 g_surfaces_instance = this; 77 g_surfaces_instance = this;
81 78
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 CHECK(resources.empty()); 182 CHECK(resources.empty());
186 } 183 }
187 184
188 void SurfacesInstance::SetBeginFrameSource( 185 void SurfacesInstance::SetBeginFrameSource(
189 cc::BeginFrameSource* begin_frame_source) { 186 cc::BeginFrameSource* begin_frame_source) {
190 // Parent compsitor calls DrawAndSwap directly and doesn't use 187 // Parent compsitor calls DrawAndSwap directly and doesn't use
191 // BeginFrameSource. 188 // BeginFrameSource.
192 } 189 }
193 190
194 } // namespace android_webview 191 } // 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