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

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

Issue 1816283005: Move SharedRendererState ownership to AwContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 // Reset draw constraints. 77 // Reset draw constraints.
78 shared_renderer_state_->PostExternalDrawConstraintsToChildCompositorOnRT( 78 shared_renderer_state_->PostExternalDrawConstraintsToChildCompositorOnRT(
79 ParentCompositorDrawConstraints()); 79 ParentCompositorDrawConstraints());
80 ReturnResourcesInChildFrame(); 80 ReturnResourcesInChildFrame();
81 } 81 }
82 82
83 void HardwareRenderer::CommitFrame() { 83 void HardwareRenderer::CommitFrame() {
84 TRACE_EVENT0("android_webview", "CommitFrame"); 84 TRACE_EVENT0("android_webview", "CommitFrame");
85 scroll_offset_ = shared_renderer_state_->GetScrollOffsetOnRT(); 85 scroll_offset_ = shared_renderer_state_->GetScrollOffsetOnRT();
86 scoped_ptr<ChildFrame> child_frame = 86 scoped_ptr<ChildFrame> child_frame = shared_renderer_state_->PassFrameOnRT();
87 shared_renderer_state_->PassCompositorFrameOnRT();
88 if (!child_frame.get()) 87 if (!child_frame.get())
89 return; 88 return;
90 89
91 last_committed_output_surface_id_ = child_frame->output_surface_id; 90 last_committed_output_surface_id_ = child_frame->output_surface_id;
92 ReturnResourcesInChildFrame(); 91 ReturnResourcesInChildFrame();
93 child_frame_ = std::move(child_frame); 92 child_frame_ = std::move(child_frame);
94 DCHECK(child_frame_->frame.get()); 93 DCHECK(child_frame_->frame.get());
95 DCHECK(!child_frame_->frame->gl_frame_data); 94 DCHECK(!child_frame_->frame->gl_frame_data);
96 } 95 }
97 96
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 const cc::ReturnedResourceArray& resources, 261 const cc::ReturnedResourceArray& resources,
263 uint32_t compositor_id, 262 uint32_t compositor_id,
264 uint32_t output_surface_id) { 263 uint32_t output_surface_id) {
265 if (output_surface_id != last_committed_output_surface_id_) 264 if (output_surface_id != last_committed_output_surface_id_)
266 return; 265 return;
267 shared_renderer_state_->InsertReturnedResourcesOnRT(resources, compositor_id, 266 shared_renderer_state_->InsertReturnedResourcesOnRT(resources, compositor_id,
268 output_surface_id); 267 output_surface_id);
269 } 268 }
270 269
271 } // namespace android_webview 270 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/browser_view_renderer_unittest.cc ('k') | android_webview/browser/shared_renderer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698