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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 331103002: aw: Remove legacy rendering path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/android/in_process/synchronous_compositor_impl.h" 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/input/input_handler.h" 9 #include "cc/input/input_handler.h"
10 #include "content/browser/android/in_process/synchronous_compositor_factory_impl .h" 10 #include "content/browser/android/in_process/synchronous_compositor_factory_impl .h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 DCHECK(CalledOnValidThread()); 82 DCHECK(CalledOnValidThread());
83 compositor_client_ = compositor_client; 83 compositor_client_ = compositor_client;
84 } 84 }
85 85
86 // static 86 // static
87 void SynchronousCompositor::SetGpuService( 87 void SynchronousCompositor::SetGpuService(
88 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { 88 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) {
89 g_factory.Get().SetDeferredGpuService(service); 89 g_factory.Get().SetDeferredGpuService(service);
90 } 90 }
91 91
92 bool SynchronousCompositorImpl::InitializeHwDraw( 92 bool SynchronousCompositorImpl::InitializeHwDraw() {
93 scoped_refptr<gfx::GLSurface> surface) {
94 DCHECK(CalledOnValidThread()); 93 DCHECK(CalledOnValidThread());
95 DCHECK(output_surface_); 94 DCHECK(output_surface_);
96 95
97 scoped_refptr<cc::ContextProvider> onscreen_context = 96 scoped_refptr<cc::ContextProvider> onscreen_context =
98 g_factory.Get().CreateOnscreenContextProviderForCompositorThread(surface); 97 g_factory.Get().CreateOnscreenContextProviderForCompositorThread();
99 98
100 bool success = output_surface_->InitializeHwDraw(onscreen_context); 99 bool success = output_surface_->InitializeHwDraw(onscreen_context);
101 100
102 if (success) 101 if (success)
103 g_factory.Get().CompositorInitializedHardwareDraw(); 102 g_factory.Get().CompositorInitializedHardwareDraw();
104 return success; 103 return success;
105 } 104 }
106 105
107 void SynchronousCompositorImpl::ReleaseHwDraw() { 106 void SynchronousCompositorImpl::ReleaseHwDraw() {
108 DCHECK(CalledOnValidThread()); 107 DCHECK(CalledOnValidThread());
109 DCHECK(output_surface_); 108 DCHECK(output_surface_);
110 output_surface_->ReleaseHwDraw(); 109 output_surface_->ReleaseHwDraw();
111 g_factory.Get().CompositorReleasedHardwareDraw(); 110 g_factory.Get().CompositorReleasedHardwareDraw();
112 } 111 }
113 112
114 gpu::GLInProcessContext* SynchronousCompositorImpl::GetShareContext() { 113 gpu::GLInProcessContext* SynchronousCompositorImpl::GetShareContext() {
115 DCHECK(CalledOnValidThread()); 114 DCHECK(CalledOnValidThread());
116 return g_factory.Get().GetShareContext(); 115 return g_factory.Get().GetShareContext();
117 } 116 }
118 117
119 scoped_ptr<cc::CompositorFrame> SynchronousCompositorImpl::DemandDrawHw( 118 scoped_ptr<cc::CompositorFrame> SynchronousCompositorImpl::DemandDrawHw(
120 gfx::Size surface_size, 119 gfx::Size surface_size,
121 const gfx::Transform& transform, 120 const gfx::Transform& transform,
122 gfx::Rect viewport, 121 gfx::Rect viewport,
123 gfx::Rect clip, 122 gfx::Rect clip) {
124 bool stencil_enabled) {
125 DCHECK(CalledOnValidThread()); 123 DCHECK(CalledOnValidThread());
126 DCHECK(output_surface_); 124 DCHECK(output_surface_);
127 125
128 scoped_ptr<cc::CompositorFrame> frame = output_surface_->DemandDrawHw( 126 scoped_ptr<cc::CompositorFrame> frame =
129 surface_size, transform, viewport, clip, stencil_enabled); 127 output_surface_->DemandDrawHw(surface_size, transform, viewport, clip);
130 if (frame.get()) 128 if (frame.get())
131 UpdateFrameMetaData(frame->metadata); 129 UpdateFrameMetaData(frame->metadata);
132 return frame.Pass(); 130 return frame.Pass();
133 } 131 }
134 132
135 void SynchronousCompositorImpl::ReturnResources( 133 void SynchronousCompositorImpl::ReturnResources(
136 const cc::CompositorFrameAck& frame_ack) { 134 const cc::CompositorFrameAck& frame_ack) {
137 DCHECK(CalledOnValidThread()); 135 DCHECK(CalledOnValidThread());
138 output_surface_->ReturnResources(frame_ack); 136 output_surface_->ReturnResources(frame_ack);
139 } 137 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 g_factory.Get(); // Ensure it's initialized. 293 g_factory.Get(); // Ensure it's initialized.
296 SynchronousCompositorImpl::CreateForWebContents(contents); 294 SynchronousCompositorImpl::CreateForWebContents(contents);
297 } 295 }
298 if (SynchronousCompositorImpl* instance = 296 if (SynchronousCompositorImpl* instance =
299 SynchronousCompositorImpl::FromWebContents(contents)) { 297 SynchronousCompositorImpl::FromWebContents(contents)) {
300 instance->SetClient(client); 298 instance->SetClient(client);
301 } 299 }
302 } 300 }
303 301
304 } // namespace content 302 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698