| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/aw_gl_surface.h" | 5 #include "android_webview/browser/aw_gl_surface.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/scoped_app_gl_state_restore.h" |
| 8 |
| 7 namespace android_webview { | 9 namespace android_webview { |
| 8 | 10 |
| 9 AwGLSurface::AwGLSurface() : fbo_(0) {} | 11 AwGLSurface::AwGLSurface() {} |
| 10 | 12 |
| 11 AwGLSurface::~AwGLSurface() {} | 13 AwGLSurface::~AwGLSurface() {} |
| 12 | 14 |
| 13 void AwGLSurface::Destroy() { | 15 void AwGLSurface::Destroy() { |
| 14 } | 16 } |
| 15 | 17 |
| 16 bool AwGLSurface::IsOffscreen() { | 18 bool AwGLSurface::IsOffscreen() { |
| 17 return false; | 19 return false; |
| 18 } | 20 } |
| 19 | 21 |
| 20 unsigned int AwGLSurface::GetBackingFramebufferObject() { | 22 unsigned int AwGLSurface::GetBackingFramebufferObject() { |
| 21 return fbo_; | 23 return ScopedAppGLStateRestore::Current()->framebuffer_binding_ext(); |
| 22 } | 24 } |
| 23 | 25 |
| 24 gfx::SwapResult AwGLSurface::SwapBuffers() { | 26 gfx::SwapResult AwGLSurface::SwapBuffers() { |
| 25 return gfx::SwapResult::SWAP_ACK; | 27 return gfx::SwapResult::SWAP_ACK; |
| 26 } | 28 } |
| 27 | 29 |
| 28 gfx::Size AwGLSurface::GetSize() { | 30 gfx::Size AwGLSurface::GetSize() { |
| 29 return gfx::Size(1, 1); | 31 return gfx::Size(1, 1); |
| 30 } | 32 } |
| 31 | 33 |
| 32 void* AwGLSurface::GetHandle() { | 34 void* AwGLSurface::GetHandle() { |
| 33 return NULL; | 35 return NULL; |
| 34 } | 36 } |
| 35 | 37 |
| 36 void* AwGLSurface::GetDisplay() { | 38 void* AwGLSurface::GetDisplay() { |
| 37 return NULL; | 39 return NULL; |
| 38 } | 40 } |
| 39 | 41 |
| 40 void AwGLSurface::SetBackingFrameBufferObject(unsigned int fbo) { | |
| 41 fbo_ = fbo; | |
| 42 } | |
| 43 | |
| 44 } // namespace android_webview | 42 } // namespace android_webview |
| OLD | NEW |