| 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 #ifndef Extensions3DUtil_h | 5 #ifndef Extensions3DUtil_h |
| 6 #define Extensions3DUtil_h | 6 #define Extensions3DUtil_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/graphics/GraphicsTypes3D.h" | 9 #include "platform/graphics/GraphicsTypes3D.h" |
| 10 #include "third_party/khronos/GLES2/gl2.h" | 10 #include "third_party/khronos/GLES2/gl2.h" |
| 11 #include "third_party/khronos/GLES2/gl2ext.h" | 11 #include "third_party/khronos/GLES2/gl2ext.h" |
| 12 #include "wtf/Allocator.h" |
| 12 #include "wtf/HashSet.h" | 13 #include "wtf/HashSet.h" |
| 14 #include "wtf/Noncopyable.h" |
| 13 #include "wtf/text/StringHash.h" | 15 #include "wtf/text/StringHash.h" |
| 14 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 15 | 17 |
| 16 namespace blink { | 18 namespace blink { |
| 17 | 19 |
| 18 class WebGraphicsContext3D; | 20 class WebGraphicsContext3D; |
| 19 | 21 |
| 20 class PLATFORM_EXPORT Extensions3DUtil { | 22 class PLATFORM_EXPORT Extensions3DUtil final { |
| 23 USING_FAST_MALLOC(Extensions3DUtil); |
| 24 WTF_MAKE_NONCOPYABLE(Extensions3DUtil); |
| 21 public: | 25 public: |
| 22 // Creates a new Extensions3DUtil. If the passed WebGraphicsContext3D has be
en spontaneously lost, returns null. | 26 // Creates a new Extensions3DUtil. If the passed WebGraphicsContext3D has be
en spontaneously lost, returns null. |
| 23 static PassOwnPtr<Extensions3DUtil> create(WebGraphicsContext3D*); | 27 static PassOwnPtr<Extensions3DUtil> create(WebGraphicsContext3D*); |
| 24 ~Extensions3DUtil(); | 28 ~Extensions3DUtil(); |
| 25 | 29 |
| 26 bool isValid() { return m_isValid; } | 30 bool isValid() { return m_isValid; } |
| 27 | 31 |
| 28 bool supportsExtension(const String& name); | 32 bool supportsExtension(const String& name); |
| 29 bool ensureExtensionEnabled(const String& name); | 33 bool ensureExtensionEnabled(const String& name); |
| 30 bool isExtensionEnabled(const String& name); | 34 bool isExtensionEnabled(const String& name); |
| 31 | 35 |
| 32 static bool canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destFormat,
GLenum destType, GLint level); | 36 static bool canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destFormat,
GLenum destType, GLint level); |
| 33 | 37 |
| 34 private: | 38 private: |
| 35 Extensions3DUtil(WebGraphicsContext3D*); | 39 Extensions3DUtil(WebGraphicsContext3D*); |
| 36 void initializeExtensions(); | 40 void initializeExtensions(); |
| 37 | 41 |
| 38 WebGraphicsContext3D* m_context; | 42 WebGraphicsContext3D* m_context; |
| 39 HashSet<String> m_enabledExtensions; | 43 HashSet<String> m_enabledExtensions; |
| 40 HashSet<String> m_requestableExtensions; | 44 HashSet<String> m_requestableExtensions; |
| 41 bool m_isValid; | 45 bool m_isValid; |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 } // namespace blink | 48 } // namespace blink |
| 45 | 49 |
| 46 #endif // Extensions3DUtil_h | 50 #endif // Extensions3DUtil_h |
| OLD | NEW |