| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // This is called after OutputSurface is created, but before the impl frame | 121 // This is called after OutputSurface is created, but before the impl frame |
| 122 // starts. We set the draw constraints here. | 122 // starts. We set the draw constraints here. |
| 123 DCHECK(output_surface_); | 123 DCHECK(output_surface_); |
| 124 DCHECK(viewport_clip_valid_for_dcheck_); | 124 DCHECK(viewport_clip_valid_for_dcheck_); |
| 125 output_surface_->SetExternalStencilTest(stencil_enabled_); | 125 output_surface_->SetExternalStencilTest(stencil_enabled_); |
| 126 output_surface_->SetDrawConstraints(viewport_, clip_); | 126 output_surface_->SetDrawConstraints(viewport_, clip_); |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool HardwareRenderer::DrawGL(bool stencil_enabled, | 129 bool HardwareRenderer::DrawGL(bool stencil_enabled, |
| 130 int framebuffer_binding_ext, | 130 int framebuffer_binding_ext, |
| 131 AwDrawGLInfo* draw_info, | 131 AwDrawGLInfo* draw_info) { |
| 132 DrawGLResult* result) { | |
| 133 TRACE_EVENT0("android_webview", "HardwareRenderer::DrawGL"); | 132 TRACE_EVENT0("android_webview", "HardwareRenderer::DrawGL"); |
| 134 | 133 |
| 135 // We need to watch if the current Android context has changed and enforce | 134 // We need to watch if the current Android context has changed and enforce |
| 136 // a clean-up in the compositor. | 135 // a clean-up in the compositor. |
| 137 EGLContext current_context = eglGetCurrentContext(); | 136 EGLContext current_context = eglGetCurrentContext(); |
| 138 if (!current_context) { | 137 if (!current_context) { |
| 139 DLOG(ERROR) << "DrawGL called without EGLContext"; | 138 DLOG(ERROR) << "DrawGL called without EGLContext"; |
| 140 return false; | 139 return false; |
| 141 } | 140 } |
| 142 | 141 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 225 } |
| 227 | 226 |
| 228 void HardwareRenderer::UnusedResourcesAreAvailable() { | 227 void HardwareRenderer::UnusedResourcesAreAvailable() { |
| 229 cc::ReturnedResourceArray returned_resources; | 228 cc::ReturnedResourceArray returned_resources; |
| 230 resource_collection_->TakeUnusedResourcesForChildCompositor( | 229 resource_collection_->TakeUnusedResourcesForChildCompositor( |
| 231 &returned_resources); | 230 &returned_resources); |
| 232 shared_renderer_state_->InsertReturnedResources(returned_resources); | 231 shared_renderer_state_->InsertReturnedResources(returned_resources); |
| 233 } | 232 } |
| 234 | 233 |
| 235 } // namespace android_webview | 234 } // namespace android_webview |
| OLD | NEW |