| 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; |
| 267 scoped_ptr<cc::CompositorFrame> frame = compositor_->DemandDrawHw( | 265 |
| 268 surface_size, transform, viewport, clip); | 266 parent_transform_ = shared_renderer_state_->ParentTransform(); |
| 267 |
| 268 scoped_ptr<cc::CompositorFrame> frame = |
| 269 compositor_->DemandDrawHw(surface_size, |
| 270 gfx::Transform(), |
| 271 viewport, |
| 272 clip, |
| 273 last_on_draw_global_visible_rect_, |
| 274 parent_transform_); |
| 269 if (!frame.get()) | 275 if (!frame.get()) |
| 270 return false; | 276 return false; |
| 271 | 277 |
| 272 GlobalTileManager::GetInstance()->DidUse(tile_manager_key_); | 278 GlobalTileManager::GetInstance()->DidUse(tile_manager_key_); |
| 273 | 279 |
| 274 frame->AssignTo(&draw_gl_input->frame); | 280 frame->AssignTo(&draw_gl_input->frame); |
| 275 ReturnUnusedResource(shared_renderer_state_->PassDrawGLInput()); | 281 ReturnUnusedResource(shared_renderer_state_->PassDrawGLInput()); |
| 276 shared_renderer_state_->SetDrawGLInput(draw_gl_input.Pass()); | 282 shared_renderer_state_->SetDrawGLInput(draw_gl_input.Pass()); |
| 277 DidComposite(); | 283 DidComposite(); |
| 278 return client_->RequestDrawGL(java_canvas, false); | 284 return client_->RequestDrawGL(java_canvas, false); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 base::StringAppendF(&str, | 757 base::StringAppendF(&str, |
| 752 "surface width height: [%d %d] ", | 758 "surface width height: [%d %d] ", |
| 753 draw_info->width, | 759 draw_info->width, |
| 754 draw_info->height); | 760 draw_info->height); |
| 755 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); | 761 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); |
| 756 } | 762 } |
| 757 return str; | 763 return str; |
| 758 } | 764 } |
| 759 | 765 |
| 760 } // namespace android_webview | 766 } // namespace android_webview |
| OLD | NEW |