OLD | NEW |
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/browser_view_renderer.h" | 5 #include "android_webview/browser/browser_view_renderer.h" |
6 | 6 |
7 #include "android_webview/browser/browser_view_renderer_client.h" | 7 #include "android_webview/browser/browser_view_renderer_client.h" |
8 #include "android_webview/browser/shared_renderer_state.h" | 8 #include "android_webview/browser/shared_renderer_state.h" |
9 #include "android_webview/common/aw_switches.h" | 9 #include "android_webview/common/aw_switches.h" |
10 #include "android_webview/public/browser/draw_gl.h" | 10 #include "android_webview/public/browser/draw_gl.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 ReturnResourceFromParent(); | 251 ReturnResourceFromParent(); |
252 SynchronousCompositorMemoryPolicy new_policy = CalculateDesiredMemoryPolicy(); | 252 SynchronousCompositorMemoryPolicy new_policy = CalculateDesiredMemoryPolicy(); |
253 RequestMemoryPolicy(new_policy); | 253 RequestMemoryPolicy(new_policy); |
254 compositor_->SetMemoryPolicy(memory_policy_); | 254 compositor_->SetMemoryPolicy(memory_policy_); |
255 | 255 |
256 scoped_ptr<DrawGLInput> draw_gl_input(new DrawGLInput); | 256 scoped_ptr<DrawGLInput> draw_gl_input(new DrawGLInput); |
257 draw_gl_input->scroll_offset = last_on_draw_scroll_offset_; | 257 draw_gl_input->scroll_offset = last_on_draw_scroll_offset_; |
258 draw_gl_input->width = width_; | 258 draw_gl_input->width = width_; |
259 draw_gl_input->height = height_; | 259 draw_gl_input->height = height_; |
260 | 260 |
261 gfx::Transform transform; | |
262 gfx::Size surface_size(width_, height_); | 261 gfx::Size surface_size(width_, height_); |
263 gfx::Rect viewport(surface_size); | 262 gfx::Rect viewport(surface_size); |
264 // TODO(boliu): Should really be |last_on_draw_global_visible_rect_|. | 263 |
265 // See crbug.com/372073. | |
266 gfx::Rect clip = viewport; | 264 gfx::Rect clip = viewport; |
| 265 |
| 266 if (shared_renderer_state_->IsParentDrawConstraintsDirty()) { |
| 267 parent_transform_ = shared_renderer_state_->ParentTransform(); |
| 268 parent_clip_ = shared_renderer_state_->ParentClip(); |
| 269 shared_renderer_state_->SetParentDrawConstraintsDirty(false); |
| 270 } |
| 271 |
267 scoped_ptr<cc::CompositorFrame> frame = compositor_->DemandDrawHw( | 272 scoped_ptr<cc::CompositorFrame> frame = compositor_->DemandDrawHw( |
268 surface_size, transform, viewport, clip); | 273 surface_size, parent_transform_, viewport, clip, parent_clip_); |
269 if (!frame.get()) | 274 if (!frame.get()) |
270 return false; | 275 return false; |
271 | 276 |
272 GlobalTileManager::GetInstance()->DidUse(tile_manager_key_); | 277 GlobalTileManager::GetInstance()->DidUse(tile_manager_key_); |
273 | 278 |
274 frame->AssignTo(&draw_gl_input->frame); | 279 frame->AssignTo(&draw_gl_input->frame); |
275 ReturnUnusedResource(shared_renderer_state_->PassDrawGLInput()); | 280 ReturnUnusedResource(shared_renderer_state_->PassDrawGLInput()); |
276 shared_renderer_state_->SetDrawGLInput(draw_gl_input.Pass()); | 281 shared_renderer_state_->SetDrawGLInput(draw_gl_input.Pass()); |
277 DidComposite(); | 282 DidComposite(); |
278 return client_->RequestDrawGL(java_canvas, false); | 283 return client_->RequestDrawGL(java_canvas, false); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 base::StringAppendF(&str, | 756 base::StringAppendF(&str, |
752 "surface width height: [%d %d] ", | 757 "surface width height: [%d %d] ", |
753 draw_info->width, | 758 draw_info->width, |
754 draw_info->height); | 759 draw_info->height); |
755 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); | 760 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); |
756 } | 761 } |
757 return str; | 762 return str; |
758 } | 763 } |
759 | 764 |
760 } // namespace android_webview | 765 } // namespace android_webview |
OLD | NEW |