Chromium Code Reviews| Index: cc/output_surface.cc |
| diff --git a/cc/output_surface.cc b/cc/output_surface.cc |
| index b48923226a8593d28b1c2adfb3c29d35f9f8b6db..a66190f6ad0400479f619194d45f5bf984d4f0be 100644 |
| --- a/cc/output_surface.cc |
| +++ b/cc/output_surface.cc |
| @@ -5,6 +5,11 @@ |
| #include "cc/output_surface.h" |
| #include "base/logging.h" |
| +#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" |
| +#include "third_party/khronos/GLES2/gl2.h" |
| +#include "third_party/khronos/GLES2/gl2ext.h" |
| +#include "ui/gfx/rect.h" |
| +#include "ui/gfx/size.h" |
| namespace cc { |
| @@ -44,4 +49,37 @@ void OutputSurface::SendFrameToParentCompositor(CompositorFrame*) { |
| NOTIMPLEMENTED(); |
| } |
| +void OutputSurface::EnsureBackbuffer() { |
| + DCHECK(context3d_); |
| + context3d_->ensureBackbufferCHROMIUM(); |
| +} |
| + |
| +void OutputSurface::DiscardBackbuffer() { |
| + DCHECK(context3d_); |
|
no sievers
2013/02/27 00:12:30
Really it should query the extension here like it
piman
2013/02/27 01:07:13
You can check in BindToClient, which has to be cal
no sievers
2013/02/27 21:07:40
Done.
|
| + context3d_->discardBackbufferCHROMIUM(); |
| +} |
| + |
| +void OutputSurface::Reshape(const gfx::Size& size) { |
| + DCHECK(context3d_); |
| + context3d_->reshape(size.width(), size.height()); |
| +} |
| + |
| +void OutputSurface::BindFramebuffer() { |
| + DCHECK(context3d_); |
| + context3d_->bindFramebuffer(GL_FRAMEBUFFER, 0); |
| +} |
| + |
| +void OutputSurface::SwapBuffers() { |
| + DCHECK(context3d_); |
| + // Note that currently this has the same effect as swapBuffers; we should |
| + // consider exposing a different entry point on WebGraphicsContext3D. |
| + context3d_->prepareTexture(); |
| +} |
| + |
| +void OutputSurface::PostSubBuffer(const gfx::Rect& rect) { |
| + DCHECK(context3d_); |
| + context3d_->postSubBufferCHROMIUM( |
| + rect.x(), rect.y(), rect.width(), rect.height()); |
| +} |
| + |
| } // namespace cc |