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

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

Issue 2036023002: Rewire Android WebView's compositor changed signal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix browse_view_renderer construction and rebase Created 4 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
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 20 matching lines...) Expand all
31 #include "ui/gfx/geometry/rect_f.h" 31 #include "ui/gfx/geometry/rect_f.h"
32 #include "ui/gfx/transform.h" 32 #include "ui/gfx/transform.h"
33 #include "ui/gl/gl_bindings.h" 33 #include "ui/gl/gl_bindings.h"
34 34
35 namespace android_webview { 35 namespace android_webview {
36 36
37 HardwareRenderer::HardwareRenderer(RenderThreadManager* state) 37 HardwareRenderer::HardwareRenderer(RenderThreadManager* state)
38 : render_thread_manager_(state), 38 : render_thread_manager_(state),
39 last_egl_context_(eglGetCurrentContext()), 39 last_egl_context_(eglGetCurrentContext()),
40 gl_surface_(new AwGLSurface), 40 gl_surface_(new AwGLSurface),
41 compositor_id_(0u), // Valid compositor id starts at 1.
42 last_committed_output_surface_id_(0u), 41 last_committed_output_surface_id_(0u),
43 last_submitted_output_surface_id_(0u), 42 last_submitted_output_surface_id_(0u),
44 output_surface_(NULL) { 43 output_surface_(NULL) {
45 DCHECK(last_egl_context_); 44 DCHECK(last_egl_context_);
46 45
47 cc::RendererSettings settings; 46 cc::RendererSettings settings;
48 47
49 // Should be kept in sync with compositor_impl_android.cc. 48 // Should be kept in sync with compositor_impl_android.cc.
50 settings.allow_antialiasing = false; 49 settings.allow_antialiasing = false;
51 settings.highp_threshold_min = 2048; 50 settings.highp_threshold_min = 2048;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // compositor_id_. 253 // compositor_id_.
255 ReturnResourcesToCompositor(resources_to_return, 254 ReturnResourcesToCompositor(resources_to_return,
256 child_frame_->compositor_id, 255 child_frame_->compositor_id,
257 child_frame_->output_surface_id); 256 child_frame_->output_surface_id);
258 } 257 }
259 child_frame_.reset(); 258 child_frame_.reset();
260 } 259 }
261 260
262 void HardwareRenderer::ReturnResourcesToCompositor( 261 void HardwareRenderer::ReturnResourcesToCompositor(
263 const cc::ReturnedResourceArray& resources, 262 const cc::ReturnedResourceArray& resources,
264 uint32_t compositor_id, 263 CompositorID compositor_id,
265 uint32_t output_surface_id) { 264 uint32_t output_surface_id) {
266 if (output_surface_id != last_committed_output_surface_id_) 265 if (output_surface_id != last_committed_output_surface_id_)
267 return; 266 return;
268 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id, 267 render_thread_manager_->InsertReturnedResourcesOnRT(resources, compositor_id,
269 output_surface_id); 268 output_surface_id);
270 } 269 }
271 270
272 } // namespace android_webview 271 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698