| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |