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

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

Issue 659743002: aw: Fallback delegated composite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and address comments Created 6 years, 2 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 "android_webview/browser/aw_gl_surface.h" 7 #include "android_webview/browser/aw_gl_surface.h"
8 #include "android_webview/browser/deferred_gpu_command_service.h" 8 #include "android_webview/browser/deferred_gpu_command_service.h"
9 #include "android_webview/browser/parent_output_surface.h" 9 #include "android_webview/browser/parent_output_surface.h"
10 #include "android_webview/browser/shared_renderer_state.h" 10 #include "android_webview/browser/shared_renderer_state.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // We need to watch if the current Android context has changed and enforce 199 // We need to watch if the current Android context has changed and enforce
200 // a clean-up in the compositor. 200 // a clean-up in the compositor.
201 EGLContext current_context = eglGetCurrentContext(); 201 EGLContext current_context = eglGetCurrentContext();
202 DCHECK(current_context) << "DrawGL called without EGLContext"; 202 DCHECK(current_context) << "DrawGL called without EGLContext";
203 203
204 // TODO(boliu): Handle context loss. 204 // TODO(boliu): Handle context loss.
205 if (last_egl_context_ != current_context) 205 if (last_egl_context_ != current_context)
206 DLOG(WARNING) << "EGLContextChanged"; 206 DLOG(WARNING) << "EGLContextChanged";
207 207
208 SetFrameData(); 208 SetFrameData();
209 if (shared_renderer_state_->ForceCommit()) {
210 CommitFrame();
211 SetFrameData();
212 }
213
209 gfx::Transform transform(gfx::Transform::kSkipInitialization); 214 gfx::Transform transform(gfx::Transform::kSkipInitialization);
210 transform.matrix().setColMajorf(draw_info->transform); 215 transform.matrix().setColMajorf(draw_info->transform);
211 transform.Translate(scroll_offset_.x(), scroll_offset_.y()); 216 transform.Translate(scroll_offset_.x(), scroll_offset_.y());
212 217
213 // Need to post the new transform matrix back to child compositor 218 // Need to post the new transform matrix back to child compositor
214 // because there is no onDraw during a Render Thread animation, and child 219 // because there is no onDraw during a Render Thread animation, and child
215 // compositor might not have the tiles rasterized as the animation goes on. 220 // compositor might not have the tiles rasterized as the animation goes on.
216 ParentCompositorDrawConstraints draw_constraints( 221 ParentCompositorDrawConstraints draw_constraints(
217 draw_info->is_layer, transform, gfx::Rect(viewport_)); 222 draw_info->is_layer, transform, gfx::Rect(viewport_));
218 223
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 262 }
258 263
259 void HardwareRenderer::UnusedResourcesAreAvailable() { 264 void HardwareRenderer::UnusedResourcesAreAvailable() {
260 cc::ReturnedResourceArray returned_resources; 265 cc::ReturnedResourceArray returned_resources;
261 resource_collection_->TakeUnusedResourcesForChildCompositor( 266 resource_collection_->TakeUnusedResourcesForChildCompositor(
262 &returned_resources); 267 &returned_resources);
263 shared_renderer_state_->InsertReturnedResources(returned_resources); 268 shared_renderer_state_->InsertReturnedResources(returned_resources);
264 } 269 }
265 270
266 } // namespace android_webview 271 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698