| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "modules/webgl/CHROMIUMValuebuffer.h" | 5 #include "modules/webgl/CHROMIUMValuebuffer.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_interface.h" | |
| 8 #include "modules/webgl/WebGLRenderingContextBase.h" | 7 #include "modules/webgl/WebGLRenderingContextBase.h" |
| 9 | 8 |
| 10 namespace blink { | 9 namespace blink { |
| 11 | 10 |
| 12 CHROMIUMValuebuffer* CHROMIUMValuebuffer::create(WebGLRenderingContextBase* ctx) | 11 CHROMIUMValuebuffer* CHROMIUMValuebuffer::create(WebGLRenderingContextBase* ctx) |
| 13 { | 12 { |
| 14 return new CHROMIUMValuebuffer(ctx); | 13 return new CHROMIUMValuebuffer(ctx); |
| 15 } | 14 } |
| 16 | 15 |
| 17 CHROMIUMValuebuffer::~CHROMIUMValuebuffer() | 16 CHROMIUMValuebuffer::~CHROMIUMValuebuffer() |
| 18 { | 17 { |
| 19 // See the comment in WebGLObject::detachAndDeleteObject(). | 18 // See the comment in WebGLObject::detachAndDeleteObject(). |
| 20 detachAndDeleteObject(); | 19 detachAndDeleteObject(); |
| 21 } | 20 } |
| 22 | 21 |
| 23 CHROMIUMValuebuffer::CHROMIUMValuebuffer(WebGLRenderingContextBase* ctx) | 22 CHROMIUMValuebuffer::CHROMIUMValuebuffer(WebGLRenderingContextBase* ctx) |
| 24 : WebGLSharedPlatform3DObject(ctx) | 23 : WebGLSharedPlatform3DObject(ctx) |
| 25 , m_hasEverBeenBound(false) | 24 , m_hasEverBeenBound(false) |
| 26 { | 25 { |
| 27 GLuint buffer; | 26 setObject(ctx->webContext()->createValuebufferCHROMIUM()); |
| 28 ctx->contextGL()->GenValuebuffersCHROMIUM(1, &buffer); | |
| 29 setObject(buffer); | |
| 30 } | 27 } |
| 31 | 28 |
| 32 void CHROMIUMValuebuffer::deleteObjectImpl(WebGraphicsContext3D* context3d, gpu:
:gles2::GLES2Interface* gl) | 29 void CHROMIUMValuebuffer::deleteObjectImpl(WebGraphicsContext3D* context3d, gpu:
:gles2::GLES2Interface* gl) |
| 33 { | 30 { |
| 34 gl->DeleteValuebuffersCHROMIUM(1, &m_object); | 31 context3d->deleteValuebufferCHROMIUM(m_object); |
| 35 m_object = 0; | 32 m_object = 0; |
| 36 } | 33 } |
| 37 | 34 |
| 38 } // namespace blink | 35 } // namespace blink |
| OLD | NEW |