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

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

Issue 2174203002: OnDrawHardware() implementation with async messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added flag to branch old and new implementation Created 4 years, 4 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 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 <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/aw_gl_surface.h" 9 #include "android_webview/browser/aw_gl_surface.h"
10 #include "android_webview/browser/aw_render_thread_context_provider.h" 10 #include "android_webview/browser/aw_render_thread_context_provider.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 void HardwareRenderer::SetBackingFrameBufferObject( 175 void HardwareRenderer::SetBackingFrameBufferObject(
176 int framebuffer_binding_ext) { 176 int framebuffer_binding_ext) {
177 surfaces_->SetBackingFrameBufferObject(framebuffer_binding_ext); 177 surfaces_->SetBackingFrameBufferObject(framebuffer_binding_ext);
178 } 178 }
179 179
180 void HardwareRenderer::ReturnResourcesInChildFrame() { 180 void HardwareRenderer::ReturnResourcesInChildFrame() {
181 if (child_frame_.get() && child_frame_->frame.get()) { 181 if (child_frame_.get() && child_frame_->frame.get()) {
182 cc::ReturnedResourceArray resources_to_return; 182 cc::ReturnedResourceArray resources_to_return;
183 DCHECK(child_frame_->frame->delegated_frame_data);
183 cc::TransferableResource::ReturnResources( 184 cc::TransferableResource::ReturnResources(
184 child_frame_->frame->delegated_frame_data->resource_list, 185 child_frame_->frame->delegated_frame_data->resource_list,
185 &resources_to_return); 186 &resources_to_return);
186 187
187 // The child frame's compositor id is not necessarily same as 188 // The child frame's compositor id is not necessarily same as
188 // compositor_id_. 189 // compositor_id_.
189 ReturnResourcesToCompositor(resources_to_return, 190 ReturnResourcesToCompositor(resources_to_return,
190 child_frame_->compositor_id, 191 child_frame_->compositor_id,
191 child_frame_->output_surface_id); 192 child_frame_->output_surface_id);
192 } 193 }
193 child_frame_.reset(); 194 child_frame_.reset();
194 } 195 }
195 196
196 void HardwareRenderer::ReturnResourcesToCompositor( 197 void HardwareRenderer::ReturnResourcesToCompositor(
197 const cc::ReturnedResourceArray& resources, 198 const cc::ReturnedResourceArray& resources,
198 const CompositorID& compositor_id, 199 const CompositorID& compositor_id,
199 uint32_t output_surface_id) { 200 uint32_t output_surface_id) {
200 if (output_surface_id != last_committed_output_surface_id_) 201 if (output_surface_id != last_committed_output_surface_id_)
201 return; 202 return;
202 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id, 203 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id,
203 output_surface_id); 204 output_surface_id);
204 } 205 }
205 206
206 } // namespace android_webview 207 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698