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 "android_webview/browser/aw_render_thread_context_provider.h" |
8 #include "android_webview/browser/scoped_app_gl_state_restore.h" | 8 #include "android_webview/browser/scoped_app_gl_state_restore.h" |
9 #include "cc/output/compositor_frame.h" | |
10 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
| 10 #include "cc/output/output_surface_frame.h" |
11 #include "gpu/command_buffer/client/gles2_interface.h" | 11 #include "gpu/command_buffer/client/gles2_interface.h" |
12 | 12 |
13 namespace android_webview { | 13 namespace android_webview { |
14 | 14 |
15 ParentOutputSurface::ParentOutputSurface( | 15 ParentOutputSurface::ParentOutputSurface( |
16 scoped_refptr<AwRenderThreadContextProvider> context_provider) | 16 scoped_refptr<AwRenderThreadContextProvider> context_provider) |
17 : cc::OutputSurface(std::move(context_provider)) { | 17 : cc::OutputSurface(std::move(context_provider)) { |
18 } | 18 } |
19 | 19 |
20 ParentOutputSurface::~ParentOutputSurface() { | 20 ParentOutputSurface::~ParentOutputSurface() { |
(...skipping 15 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 void ParentOutputSurface::Reshape(const gfx::Size& size, | 38 void ParentOutputSurface::Reshape(const gfx::Size& size, |
39 float scale_factor, | 39 float scale_factor, |
40 const gfx::ColorSpace& color_space, | 40 const gfx::ColorSpace& color_space, |
41 bool has_alpha) { | 41 bool has_alpha) { |
42 DCHECK_EQ(1.f, scale_factor); | 42 DCHECK_EQ(1.f, scale_factor); |
43 surface_size_ = size; | 43 surface_size_ = size; |
44 } | 44 } |
45 | 45 |
46 void ParentOutputSurface::SwapBuffers(cc::CompositorFrame frame) { | 46 void ParentOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) { |
47 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); | 47 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); |
48 } | 48 } |
49 | 49 |
50 bool ParentOutputSurface::HasExternalStencilTest() const { | 50 bool ParentOutputSurface::HasExternalStencilTest() const { |
51 return ScopedAppGLStateRestore::Current() | 51 return ScopedAppGLStateRestore::Current() |
52 ->stencil_state() | 52 ->stencil_state() |
53 .stencil_test_enabled; | 53 .stencil_test_enabled; |
54 } | 54 } |
55 | 55 |
56 void ParentOutputSurface::ApplyExternalStencil() { | 56 void ParentOutputSurface::ApplyExternalStencil() { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 unsigned ParentOutputSurface::GetOverlayTextureId() const { | 91 unsigned ParentOutputSurface::GetOverlayTextureId() const { |
92 return 0; | 92 return 0; |
93 } | 93 } |
94 | 94 |
95 bool ParentOutputSurface::SurfaceIsSuspendForRecycle() const { | 95 bool ParentOutputSurface::SurfaceIsSuspendForRecycle() const { |
96 return false; | 96 return false; |
97 } | 97 } |
98 | 98 |
99 } // namespace android_webview | 99 } // namespace android_webview |
OLD | NEW |