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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "modules/webgl/CHROMIUMSubscribeUniform.h" | 7 #include "modules/webgl/CHROMIUMSubscribeUniform.h" |
8 | 8 |
9 #include "modules/webgl/CHROMIUMValuebuffer.h" | 9 #include "modules/webgl/CHROMIUMValuebuffer.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 CHROMIUMSubscribeUniform::CHROMIUMSubscribeUniform(WebGLRenderingContextBase* co
ntext) | 13 CHROMIUMSubscribeUniform::CHROMIUMSubscribeUniform(WebGLRenderingContextBase* co
ntext) |
14 : WebGLExtension(context) | 14 : WebGLExtension(context) |
15 { | 15 { |
16 context->extensionsUtil()->ensureExtensionEnabled("GL_CHROMIUM_subscribe_uni
form"); | 16 context->extensionsUtil()->ensureExtensionEnabled("GL_CHROMIUM_subscribe_uni
form"); |
17 } | 17 } |
18 | 18 |
19 CHROMIUMSubscribeUniform::~CHROMIUMSubscribeUniform() | 19 CHROMIUMSubscribeUniform::~CHROMIUMSubscribeUniform() |
20 { | 20 { |
21 } | 21 } |
22 | 22 |
23 WebGLExtensionName CHROMIUMSubscribeUniform::name() const | 23 WebGLExtensionName CHROMIUMSubscribeUniform::name() const |
24 { | 24 { |
25 return CHROMIUMSubscribeUniformName; | 25 return CHROMIUMSubscribeUniformName; |
26 } | 26 } |
27 | 27 |
28 PassRefPtrWillBeRawPtr<CHROMIUMSubscribeUniform> CHROMIUMSubscribeUniform::creat
e(WebGLRenderingContextBase* context) | 28 CHROMIUMSubscribeUniform* CHROMIUMSubscribeUniform::create(WebGLRenderingContext
Base* context) |
29 { | 29 { |
30 return adoptRefWillBeNoop(new CHROMIUMSubscribeUniform(context)); | 30 return new CHROMIUMSubscribeUniform(context); |
31 } | 31 } |
32 | 32 |
33 bool CHROMIUMSubscribeUniform::supported(WebGLRenderingContextBase* context) | 33 bool CHROMIUMSubscribeUniform::supported(WebGLRenderingContextBase* context) |
34 { | 34 { |
35 return context->extensionsUtil()->supportsExtension("GL_CHROMIUM_subscribe_u
niform"); | 35 return context->extensionsUtil()->supportsExtension("GL_CHROMIUM_subscribe_u
niform"); |
36 } | 36 } |
37 | 37 |
38 const char* CHROMIUMSubscribeUniform::extensionName() | 38 const char* CHROMIUMSubscribeUniform::extensionName() |
39 { | 39 { |
40 return "CHROMIUM_subscribe_uniform"; | 40 return "CHROMIUM_subscribe_uniform"; |
41 } | 41 } |
42 | 42 |
43 PassRefPtrWillBeRawPtr<CHROMIUMValuebuffer> CHROMIUMSubscribeUniform::createValu
ebufferCHROMIUM() | 43 CHROMIUMValuebuffer* CHROMIUMSubscribeUniform::createValuebufferCHROMIUM() |
44 { | 44 { |
45 WebGLExtensionScopedContext scoped(this); | 45 WebGLExtensionScopedContext scoped(this); |
46 if (scoped.isLost()) | 46 if (scoped.isLost()) |
47 return nullptr; | 47 return nullptr; |
48 | 48 |
49 return scoped.context()->createValuebufferCHROMIUM(); | 49 return scoped.context()->createValuebufferCHROMIUM(); |
50 } | 50 } |
51 | 51 |
52 void CHROMIUMSubscribeUniform::deleteValuebufferCHROMIUM(CHROMIUMValuebuffer* va
luebuffer) | 52 void CHROMIUMSubscribeUniform::deleteValuebufferCHROMIUM(CHROMIUMValuebuffer* va
luebuffer) |
53 { | 53 { |
(...skipping 43 matching lines...) Loading... |
97 void CHROMIUMSubscribeUniform::uniformValuebufferCHROMIUM(const WebGLUniformLoca
tion* location, GLenum target, GLenum subscription) | 97 void CHROMIUMSubscribeUniform::uniformValuebufferCHROMIUM(const WebGLUniformLoca
tion* location, GLenum target, GLenum subscription) |
98 { | 98 { |
99 WebGLExtensionScopedContext scoped(this); | 99 WebGLExtensionScopedContext scoped(this); |
100 if (scoped.isLost() || !location) | 100 if (scoped.isLost() || !location) |
101 return; | 101 return; |
102 | 102 |
103 scoped.context()->uniformValuebufferCHROMIUM(location, target, subscription)
; | 103 scoped.context()->uniformValuebufferCHROMIUM(location, target, subscription)
; |
104 } | 104 } |
105 | 105 |
106 } // namespace blink | 106 } // namespace blink |
OLD | NEW |