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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 } | 117 } |
118 | 118 |
119 void HardwareRenderer::DidBeginMainFrame() { | 119 void HardwareRenderer::DidBeginMainFrame() { |
120 // This is called after OutputSurface is created, but before the impl frame | 120 // This is called after OutputSurface is created, but before the impl frame |
121 // starts. We set the draw constraints here. | 121 // starts. We set the draw constraints here. |
122 DCHECK(output_surface_); | 122 DCHECK(output_surface_); |
123 DCHECK(viewport_clip_valid_for_dcheck_); | 123 DCHECK(viewport_clip_valid_for_dcheck_); |
124 output_surface_->SetDrawConstraints(viewport_, clip_); | 124 output_surface_->SetDrawConstraints(viewport_, clip_); |
125 } | 125 } |
126 | 126 |
127 bool HardwareRenderer::DrawGL(bool stencil_enabled, | 127 bool HardwareRenderer::DrawGL(bool stencil_enabled, |
hush (inactive)
2014/06/16 21:41:50
what is this? why is it not used?
boliu
2014/06/16 22:43:27
Ehh...I think I dropped this accidentally.
So whe
| |
128 int framebuffer_binding_ext, | 128 int framebuffer_binding_ext, |
129 AwDrawGLInfo* draw_info, | 129 AwDrawGLInfo* draw_info) { |
130 DrawGLResult* result) { | |
131 TRACE_EVENT0("android_webview", "HardwareRenderer::DrawGL"); | 130 TRACE_EVENT0("android_webview", "HardwareRenderer::DrawGL"); |
132 | 131 |
133 // We need to watch if the current Android context has changed and enforce | 132 // We need to watch if the current Android context has changed and enforce |
134 // a clean-up in the compositor. | 133 // a clean-up in the compositor. |
135 EGLContext current_context = eglGetCurrentContext(); | 134 EGLContext current_context = eglGetCurrentContext(); |
136 if (!current_context) { | 135 if (!current_context) { |
137 DLOG(ERROR) << "DrawGL called without EGLContext"; | 136 DLOG(ERROR) << "DrawGL called without EGLContext"; |
138 return false; | 137 return false; |
139 } | 138 } |
140 | 139 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 } | 222 } |
224 | 223 |
225 void HardwareRenderer::UnusedResourcesAreAvailable() { | 224 void HardwareRenderer::UnusedResourcesAreAvailable() { |
226 cc::ReturnedResourceArray returned_resources; | 225 cc::ReturnedResourceArray returned_resources; |
227 resource_collection_->TakeUnusedResourcesForChildCompositor( | 226 resource_collection_->TakeUnusedResourcesForChildCompositor( |
228 &returned_resources); | 227 &returned_resources); |
229 shared_renderer_state_->InsertReturnedResources(returned_resources); | 228 shared_renderer_state_->InsertReturnedResources(returned_resources); |
230 } | 229 } |
231 | 230 |
232 } // namespace android_webview | 231 } // namespace android_webview |
OLD | NEW |