• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef Extensions3DUtil_h
6 #define Extensions3DUtil_h
7 
8 #include "platform/PlatformExport.h"
9 #include "platform/graphics/GraphicsTypes3D.h"
10 #include "third_party/khronos/GLES2/gl2.h"
11 #include "third_party/khronos/GLES2/gl2ext.h"
12 #include "wtf/HashSet.h"
13 #include "wtf/text/WTFString.h"
14 
15 namespace blink {
16 
17 class WebGraphicsContext3D;
18 
19 class PLATFORM_EXPORT Extensions3DUtil {
20 public:
21     // Creates a new Extensions3DUtil. If the passed WebGraphicsContext3D has been spontaneously lost, returns null.
22     static PassOwnPtr<Extensions3DUtil> create(WebGraphicsContext3D*);
23     ~Extensions3DUtil();
24 
25     bool supportsExtension(const String& name);
26     bool ensureExtensionEnabled(const String& name);
27     bool isExtensionEnabled(const String& name);
28 
29     static bool canUseCopyTextureCHROMIUM(GLenum destFormat, GLenum destType, GLint level);
30 
31 private:
32     Extensions3DUtil(WebGraphicsContext3D*);
33     bool initializeExtensions();
34 
35     WebGraphicsContext3D* m_context;
36     HashSet<String> m_enabledExtensions;
37     HashSet<String> m_requestableExtensions;
38 };
39 
40 } // namespace blink
41 
42 #endif // Extensions3DUtil_h
43