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

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

Issue 2136413002: Update Surface ID Terminology (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed webkit_unit_tests Created 4 years, 5 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 14 matching lines...) Expand all
25 25
26 HardwareRenderer::HardwareRenderer(RenderThreadManager* state) 26 HardwareRenderer::HardwareRenderer(RenderThreadManager* state)
27 : render_thread_manager_(state), 27 : render_thread_manager_(state),
28 last_egl_context_(eglGetCurrentContext()), 28 last_egl_context_(eglGetCurrentContext()),
29 surfaces_(SurfacesInstance::GetOrCreateInstance()), 29 surfaces_(SurfacesInstance::GetOrCreateInstance()),
30 surface_id_allocator_(surfaces_->CreateSurfaceIdAllocator()), 30 surface_id_allocator_(surfaces_->CreateSurfaceIdAllocator()),
31 last_committed_output_surface_id_(0u), 31 last_committed_output_surface_id_(0u),
32 last_submitted_output_surface_id_(0u) { 32 last_submitted_output_surface_id_(0u) {
33 DCHECK(last_egl_context_); 33 DCHECK(last_egl_context_);
34 surfaces_->GetSurfaceManager()->RegisterSurfaceFactoryClient( 34 surfaces_->GetSurfaceManager()->RegisterSurfaceFactoryClient(
35 surface_id_allocator_->id_namespace(), this); 35 surface_id_allocator_->client_id(), this);
36 } 36 }
37 37
38 HardwareRenderer::~HardwareRenderer() { 38 HardwareRenderer::~HardwareRenderer() {
39 // Must reset everything before |surface_factory_| to ensure all 39 // Must reset everything before |surface_factory_| to ensure all
40 // resources are returned before resetting. 40 // resources are returned before resetting.
41 if (!child_id_.is_null()) 41 if (!child_id_.is_null())
42 DestroySurface(); 42 DestroySurface();
43 surface_factory_.reset(); 43 surface_factory_.reset();
44 surfaces_->GetSurfaceManager()->UnregisterSurfaceFactoryClient( 44 surfaces_->GetSurfaceManager()->UnregisterSurfaceFactoryClient(
45 surface_id_allocator_->id_namespace()); 45 surface_id_allocator_->client_id());
46 46
47 // Reset draw constraints. 47 // Reset draw constraints.
48 render_thread_manager_->PostExternalDrawConstraintsToChildCompositorOnRT( 48 render_thread_manager_->PostExternalDrawConstraintsToChildCompositorOnRT(
49 ParentCompositorDrawConstraints()); 49 ParentCompositorDrawConstraints());
50 ReturnResourcesInChildFrame(); 50 ReturnResourcesInChildFrame();
51 } 51 }
52 52
53 void HardwareRenderer::CommitFrame() { 53 void HardwareRenderer::CommitFrame() {
54 TRACE_EVENT0("android_webview", "CommitFrame"); 54 TRACE_EVENT0("android_webview", "CommitFrame");
55 scroll_offset_ = render_thread_manager_->GetScrollOffsetOnRT(); 55 scroll_offset_ = render_thread_manager_->GetScrollOffsetOnRT();
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 const cc::ReturnedResourceArray& resources, 192 const cc::ReturnedResourceArray& resources,
193 const CompositorID& compositor_id, 193 const CompositorID& compositor_id,
194 uint32_t output_surface_id) { 194 uint32_t output_surface_id) {
195 if (output_surface_id != last_committed_output_surface_id_) 195 if (output_surface_id != last_committed_output_surface_id_)
196 return; 196 return;
197 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id, 197 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id,
198 output_surface_id); 198 output_surface_id);
199 } 199 }
200 200
201 } // namespace android_webview 201 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/surfaces_instance.h » ('j') | cc/proto/layer_tree_host.proto » ('J')

Powered by Google App Engine
This is Rietveld 408576698