diff options
Diffstat (limited to 'chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc')
-rw-r--r-- | chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc index 9a57aa8..f5dac44 100644 --- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc +++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc @@ -39,6 +39,15 @@ WebGraphicsContext3DCommandBufferImpl:: bool WebGraphicsContext3DCommandBufferImpl::initialize( WebGraphicsContext3D::Attributes attributes, + WebKit::WebView* web_view, + bool render_directly_to_web_view) { + // TODO(kbr): implement this fully once WebView::graphicsContext3D() + // is exposed upstream. + return initialize(attributes, web_view); +} + +bool WebGraphicsContext3DCommandBufferImpl::initialize( + WebGraphicsContext3D::Attributes attributes, WebKit::WebView* web_view) { bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableAcceleratedCompositing); @@ -254,6 +263,53 @@ bool WebGraphicsContext3DCommandBufferImpl::supportsBGRA() { return is_supported; } +bool WebGraphicsContext3DCommandBufferImpl::supportsMapSubCHROMIUM() { + static bool is_supported = supports_extension("GL_CHROMIUM_map_sub"); + return is_supported; +} + +void* WebGraphicsContext3DCommandBufferImpl::mapBufferSubDataCHROMIUM( + unsigned target, + int offset, + int size, + unsigned access) { + return glMapBufferSubData(target, offset, size, access); +} + +void WebGraphicsContext3DCommandBufferImpl::unmapBufferSubDataCHROMIUM( + const void* mem) { + return glUnmapBufferSubData(mem); +} + +void* WebGraphicsContext3DCommandBufferImpl::mapTexSubImage2DCHROMIUM( + unsigned target, + int level, + int xoffset, + int yoffset, + int width, + int height, + unsigned format, + unsigned type, + unsigned access) { + return glMapTexSubImage2D( + target, level, xoffset, yoffset, width, height, format, type, access); +} + +void WebGraphicsContext3DCommandBufferImpl::unmapTexSubImage2DCHROMIUM( + const void* mem) { + glUnmapTexSubImage2D(mem); +} + +bool WebGraphicsContext3DCommandBufferImpl:: + supportsCopyTextureToParentTextureCHROMIUM() { + return true; +} + +void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( + unsigned texture, unsigned parentTexture) { + copyTextureToCompositor(texture, parentTexture); +} + // Helper macros to reduce the amount of code. #define DELEGATE_TO_GL(name, glname) \ |