| 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/parent_output_surface.h" | 5 #include "android_webview/browser/parent_output_surface.h" | 
| 6 | 6 | 
|  | 7 #include "android_webview/browser/aw_render_thread_context_provider.h" | 
| 7 #include "cc/output/output_surface_client.h" | 8 #include "cc/output/output_surface_client.h" | 
| 8 #include "gpu/command_buffer/client/gles2_interface.h" | 9 #include "gpu/command_buffer/client/gles2_interface.h" | 
| 9 | 10 | 
| 10 namespace android_webview { | 11 namespace android_webview { | 
| 11 | 12 | 
| 12 ParentOutputSurface::ParentOutputSurface( | 13 ParentOutputSurface::ParentOutputSurface( | 
| 13     scoped_refptr<cc::ContextProvider> context_provider) | 14     scoped_refptr<AwRenderThreadContextProvider> context_provider) | 
| 14     : cc::OutputSurface(std::move(context_provider), nullptr, nullptr) { | 15     : cc::OutputSurface(std::move(context_provider), nullptr, nullptr) { | 
| 15   stencil_state_.stencil_test_enabled = false; | 16   stencil_state_.stencil_test_enabled = false; | 
| 16 } | 17 } | 
| 17 | 18 | 
| 18 ParentOutputSurface::~ParentOutputSurface() { | 19 ParentOutputSurface::~ParentOutputSurface() { | 
| 19 } | 20 } | 
| 20 | 21 | 
| 21 void ParentOutputSurface::DidLoseOutputSurface() { | 22 void ParentOutputSurface::DidLoseOutputSurface() { | 
| 22   // Android WebView does not handle context loss. | 23   // Android WebView does not handle context loss. | 
| 23   LOG(FATAL) << "Render thread context loss"; | 24   LOG(FATAL) << "Render thread context loss"; | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 47   gl->StencilMaskSeparate(GL_FRONT, stencil_state_.stencil_front_writemask); | 48   gl->StencilMaskSeparate(GL_FRONT, stencil_state_.stencil_front_writemask); | 
| 48   gl->StencilMaskSeparate(GL_BACK, stencil_state_.stencil_back_writemask); | 49   gl->StencilMaskSeparate(GL_BACK, stencil_state_.stencil_back_writemask); | 
| 49   gl->StencilOpSeparate(GL_FRONT, stencil_state_.stencil_front_fail_op, | 50   gl->StencilOpSeparate(GL_FRONT, stencil_state_.stencil_front_fail_op, | 
| 50                         stencil_state_.stencil_front_z_fail_op, | 51                         stencil_state_.stencil_front_z_fail_op, | 
| 51                         stencil_state_.stencil_front_z_pass_op); | 52                         stencil_state_.stencil_front_z_pass_op); | 
| 52   gl->StencilOpSeparate(GL_BACK, stencil_state_.stencil_back_fail_op, | 53   gl->StencilOpSeparate(GL_BACK, stencil_state_.stencil_back_fail_op, | 
| 53                         stencil_state_.stencil_back_z_fail_op, | 54                         stencil_state_.stencil_back_z_fail_op, | 
| 54                         stencil_state_.stencil_back_z_pass_op); | 55                         stencil_state_.stencil_back_z_pass_op); | 
| 55 } | 56 } | 
| 56 | 57 | 
|  | 58 uint32_t ParentOutputSurface::GetFramebufferCopyTextureFormat() { | 
|  | 59   auto* gl = static_cast<AwRenderThreadContextProvider*>(context_provider()); | 
|  | 60   return gl->GetCopyTextureInternalFormat(); | 
|  | 61 } | 
|  | 62 | 
| 57 void ParentOutputSurface::SetGLState(const ScopedAppGLStateRestore& gl_state) { | 63 void ParentOutputSurface::SetGLState(const ScopedAppGLStateRestore& gl_state) { | 
| 58   stencil_state_ = gl_state.stencil_state(); | 64   stencil_state_ = gl_state.stencil_state(); | 
| 59   SetExternalStencilTest(stencil_state_.stencil_test_enabled); | 65   SetExternalStencilTest(stencil_state_.stencil_test_enabled); | 
| 60 } | 66 } | 
| 61 | 67 | 
| 62 }  // namespace android_webview | 68 }  // namespace android_webview | 
| OLD | NEW | 
|---|