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/render_thread_manager.h" | 5 #include "android_webview/browser/render_thread_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/child_frame.h" | 9 #include "android_webview/browser/child_frame.h" |
10 #include "android_webview/browser/compositor_frame_producer.h" | 10 #include "android_webview/browser/compositor_frame_producer.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 ScopedAppGLStateRestore state_restore( | 283 ScopedAppGLStateRestore state_restore( |
284 draw_info->mode == AwDrawGLInfo::kModeDraw | 284 draw_info->mode == AwDrawGLInfo::kModeDraw |
285 ? ScopedAppGLStateRestore::MODE_DRAW | 285 ? ScopedAppGLStateRestore::MODE_DRAW |
286 : ScopedAppGLStateRestore::MODE_RESOURCE_MANAGEMENT); | 286 : ScopedAppGLStateRestore::MODE_RESOURCE_MANAGEMENT); |
287 // Set the correct FBO before kModeDraw. The GL commands run in kModeDraw | 287 // Set the correct FBO before kModeDraw. The GL commands run in kModeDraw |
288 // require a correctly bound FBO. The FBO remains until the next kModeDraw. | 288 // require a correctly bound FBO. The FBO remains until the next kModeDraw. |
289 // So kModeProcess between kModeDraws has correctly bound FBO, too. | 289 // So kModeProcess between kModeDraws has correctly bound FBO, too. |
290 if (draw_info->mode == AwDrawGLInfo::kModeDraw && !hardware_renderer_ && | |
291 !IsInsideHardwareRelease() && HasFrameForHardwareRendererOnRT()) { | |
292 hardware_renderer_.reset(new HardwareRenderer(this)); | |
293 hardware_renderer_->CommitFrame(); | |
294 } | |
295 if (hardware_renderer_) { | 290 if (hardware_renderer_) { |
296 hardware_renderer_->SetBackingFrameBufferObject( | 291 hardware_renderer_->SetBackingFrameBufferObject( |
danakj
2016/06/10 23:13:10
Do you mean for this to be above the creation of h
boliu
2016/06/10 23:15:01
I added it right below new HardwareRenderer too :)
danakj
2016/06/10 23:19:05
Oh ok, I was thinking of just moving the ScopedAll
| |
297 state_restore.framebuffer_binding_ext()); | 292 state_restore.framebuffer_binding_ext()); |
298 } | 293 } |
299 | 294 |
300 ScopedAllowGL allow_gl; | 295 ScopedAllowGL allow_gl; |
296 if (draw_info->mode == AwDrawGLInfo::kModeDraw && !hardware_renderer_ && | |
297 !IsInsideHardwareRelease() && HasFrameForHardwareRendererOnRT()) { | |
298 hardware_renderer_.reset(new HardwareRenderer(this)); | |
299 hardware_renderer_->SetBackingFrameBufferObject( | |
300 state_restore.framebuffer_binding_ext()); | |
301 hardware_renderer_->CommitFrame(); | |
302 } | |
303 | |
301 | 304 |
302 if (draw_info->mode == AwDrawGLInfo::kModeProcessNoContext) { | 305 if (draw_info->mode == AwDrawGLInfo::kModeProcessNoContext) { |
303 LOG(ERROR) << "Received unexpected kModeProcessNoContext"; | 306 LOG(ERROR) << "Received unexpected kModeProcessNoContext"; |
304 } | 307 } |
305 | 308 |
306 if (IsInsideHardwareRelease()) { | 309 if (IsInsideHardwareRelease()) { |
307 hardware_renderer_has_frame_ = false; | 310 hardware_renderer_has_frame_ = false; |
308 hardware_renderer_.reset(); | 311 hardware_renderer_.reset(); |
309 // Flush the idle queue in tear down. | 312 // Flush the idle queue in tear down. |
310 DeferredGpuCommandService::GetInstance()->PerformAllIdleWork(); | 313 DeferredGpuCommandService::GetInstance()->PerformAllIdleWork(); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 : render_thread_manager_(render_thread_manager) { | 396 : render_thread_manager_(render_thread_manager) { |
394 DCHECK(!render_thread_manager_->IsInsideHardwareRelease()); | 397 DCHECK(!render_thread_manager_->IsInsideHardwareRelease()); |
395 render_thread_manager_->SetInsideHardwareRelease(true); | 398 render_thread_manager_->SetInsideHardwareRelease(true); |
396 } | 399 } |
397 | 400 |
398 RenderThreadManager::InsideHardwareReleaseReset::~InsideHardwareReleaseReset() { | 401 RenderThreadManager::InsideHardwareReleaseReset::~InsideHardwareReleaseReset() { |
399 render_thread_manager_->SetInsideHardwareRelease(false); | 402 render_thread_manager_->SetInsideHardwareRelease(false); |
400 } | 403 } |
401 | 404 |
402 } // namespace android_webview | 405 } // namespace android_webview |
OLD | NEW |