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 "cc/output/output_surface_client.h" | 7 #include "cc/output/output_surface_client.h" |
8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
9 | 9 |
10 namespace android_webview { | 10 namespace android_webview { |
11 | 11 |
12 ParentOutputSurface::ParentOutputSurface( | 12 ParentOutputSurface::ParentOutputSurface( |
13 scoped_refptr<cc::ContextProvider> context_provider) | 13 scoped_refptr<cc::ContextProvider> context_provider) |
14 : cc::OutputSurface(context_provider) { | 14 : cc::OutputSurface(context_provider) { |
15 } | 15 } |
16 | 16 |
17 ParentOutputSurface::~ParentOutputSurface() { | 17 ParentOutputSurface::~ParentOutputSurface() { |
18 } | 18 } |
19 | 19 |
| 20 void ParentOutputSurface::DidLoseOutputSurface() { |
| 21 // Android WebView does not handle context loss. |
| 22 LOG(FATAL) << "Render thread context loss"; |
| 23 } |
| 24 |
20 void ParentOutputSurface::Reshape(const gfx::Size& size, | 25 void ParentOutputSurface::Reshape(const gfx::Size& size, |
21 float scale_factor, | 26 float scale_factor, |
22 bool has_alpha) { | 27 bool has_alpha) { |
23 DCHECK_EQ(1.f, scale_factor); | 28 DCHECK_EQ(1.f, scale_factor); |
24 surface_size_ = size; | 29 surface_size_ = size; |
25 } | 30 } |
26 | 31 |
27 void ParentOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { | 32 void ParentOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { |
28 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); | 33 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); |
29 client_->DidSwapBuffers(); | 34 client_->DidSwapBuffers(); |
30 } | 35 } |
31 | 36 |
32 } // namespace android_webview | 37 } // namespace android_webview |
OLD | NEW |