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/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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 SetFrameData(); | 209 SetFrameData(); |
210 gfx::Transform transform(gfx::Transform::kSkipInitialization); | 210 gfx::Transform transform(gfx::Transform::kSkipInitialization); |
211 transform.matrix().setColMajorf(draw_info->transform); | 211 transform.matrix().setColMajorf(draw_info->transform); |
212 transform.Translate(scroll_offset_.x(), scroll_offset_.y()); | 212 transform.Translate(scroll_offset_.x(), scroll_offset_.y()); |
213 | 213 |
214 // Need to post the new transform matrix back to child compositor | 214 // Need to post the new transform matrix back to child compositor |
215 // because there is no onDraw during a Render Thread animation, and child | 215 // because there is no onDraw during a Render Thread animation, and child |
216 // compositor might not have the tiles rasterized as the animation goes on. | 216 // compositor might not have the tiles rasterized as the animation goes on. |
217 ParentCompositorDrawConstraints draw_constraints( | 217 ParentCompositorDrawConstraints draw_constraints( |
218 draw_info->is_layer, transform, gfx::Rect(viewport_)); | 218 draw_info->is_layer, transform, gfx::Rect(viewport_)); |
219 if (!draw_constraints_.Equals(draw_constraints)) { | 219 |
220 draw_constraints_ = draw_constraints; | 220 draw_constraints_ = draw_constraints; |
221 shared_renderer_state_->PostExternalDrawConstraintsToChildCompositor( | 221 shared_renderer_state_->PostExternalDrawConstraintsToChildCompositor( |
222 draw_constraints); | 222 draw_constraints); |
223 } | |
224 | 223 |
225 if (!delegated_layer_.get()) | 224 if (!delegated_layer_.get()) |
226 return; | 225 return; |
227 | 226 |
228 viewport_.SetSize(draw_info->width, draw_info->height); | 227 viewport_.SetSize(draw_info->width, draw_info->height); |
229 layer_tree_host_->SetViewportSize(viewport_); | 228 layer_tree_host_->SetViewportSize(viewport_); |
230 clip_.SetRect(draw_info->clip_left, | 229 clip_.SetRect(draw_info->clip_left, |
231 draw_info->clip_top, | 230 draw_info->clip_top, |
232 draw_info->clip_right - draw_info->clip_left, | 231 draw_info->clip_right - draw_info->clip_left, |
233 draw_info->clip_bottom - draw_info->clip_top); | 232 draw_info->clip_bottom - draw_info->clip_top); |
(...skipping 25 matching lines...) Expand all Loading... |
259 } | 258 } |
260 | 259 |
261 void HardwareRenderer::UnusedResourcesAreAvailable() { | 260 void HardwareRenderer::UnusedResourcesAreAvailable() { |
262 cc::ReturnedResourceArray returned_resources; | 261 cc::ReturnedResourceArray returned_resources; |
263 resource_collection_->TakeUnusedResourcesForChildCompositor( | 262 resource_collection_->TakeUnusedResourcesForChildCompositor( |
264 &returned_resources); | 263 &returned_resources); |
265 shared_renderer_state_->InsertReturnedResources(returned_resources); | 264 shared_renderer_state_->InsertReturnedResources(returned_resources); |
266 } | 265 } |
267 | 266 |
268 } // namespace android_webview | 267 } // namespace android_webview |
OLD | NEW |