| 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 "platform/graphics/gpu/Extensions3DUtil.h" |   5 #include "platform/graphics/gpu/Extensions3DUtil.h" | 
|   6  |   6  | 
|   7 #include "gpu/command_buffer/client/gles2_interface.h" |   7 #include "gpu/command_buffer/client/gles2_interface.h" | 
|   8 #include "public/platform/WebGraphicsContext3D.h" |   8 #include "public/platform/WebGraphicsContext3D.h" | 
|   9 #include "wtf/text/CString.h" |   9 #include "wtf/text/CString.h" | 
|  10 #include "wtf/text/StringHash.h" |  10 #include "wtf/text/StringHash.h" | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  62 { |  62 { | 
|  63     return m_enabledExtensions.contains(name) || m_requestableExtensions.contain
    s(name); |  63     return m_enabledExtensions.contains(name) || m_requestableExtensions.contain
    s(name); | 
|  64 } |  64 } | 
|  65  |  65  | 
|  66 bool Extensions3DUtil::ensureExtensionEnabled(const String& name) |  66 bool Extensions3DUtil::ensureExtensionEnabled(const String& name) | 
|  67 { |  67 { | 
|  68     if (m_enabledExtensions.contains(name)) |  68     if (m_enabledExtensions.contains(name)) | 
|  69         return true; |  69         return true; | 
|  70  |  70  | 
|  71     if (m_requestableExtensions.contains(name)) { |  71     if (m_requestableExtensions.contains(name)) { | 
|  72         m_context->requestExtensionCHROMIUM(name.ascii().data()); |  72         m_gl->RequestExtensionCHROMIUM(name.ascii().data()); | 
|  73         m_enabledExtensions.clear(); |  73         m_enabledExtensions.clear(); | 
|  74         m_requestableExtensions.clear(); |  74         m_requestableExtensions.clear(); | 
|  75         initializeExtensions(); |  75         initializeExtensions(); | 
|  76     } |  76     } | 
|  77     return m_enabledExtensions.contains(name); |  77     return m_enabledExtensions.contains(name); | 
|  78 } |  78 } | 
|  79  |  79  | 
|  80 bool Extensions3DUtil::isExtensionEnabled(const String& name) |  80 bool Extensions3DUtil::isExtensionEnabled(const String& name) | 
|  81 { |  81 { | 
|  82     return m_enabledExtensions.contains(name); |  82     return m_enabledExtensions.contains(name); | 
|  83 } |  83 } | 
|  84  |  84  | 
|  85 bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destF
    ormat, GLenum destType, GLint level) |  85 bool Extensions3DUtil::canUseCopyTextureCHROMIUM(GLenum destTarget, GLenum destF
    ormat, GLenum destType, GLint level) | 
|  86 { |  86 { | 
|  87     // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lif
    ted when |  87     // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lif
    ted when | 
|  88     // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional. |  88     // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional. | 
|  89     if (destTarget == GL_TEXTURE_2D && (destFormat == GL_RGB || destFormat == GL
    _RGBA) |  89     if (destTarget == GL_TEXTURE_2D && (destFormat == GL_RGB || destFormat == GL
    _RGBA) | 
|  90         && destType == GL_UNSIGNED_BYTE |  90         && destType == GL_UNSIGNED_BYTE | 
|  91         && !level) |  91         && !level) | 
|  92         return true; |  92         return true; | 
|  93     return false; |  93     return false; | 
|  94 } |  94 } | 
|  95  |  95  | 
|  96 } // namespace blink |  96 } // namespace blink | 
| OLD | NEW |