diff options
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/Android.mk | 1 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/BaseTile.h | 2 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/SharedTexture.cpp | 27 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/SharedTexture.h | 23 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/TextureInfo.cpp | 57 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/TextureInfo.h | 57 |
6 files changed, 117 insertions, 50 deletions
diff --git a/Source/WebCore/Android.mk b/Source/WebCore/Android.mk index 83c2182..83bfc91 100644 --- a/Source/WebCore/Android.mk +++ b/Source/WebCore/Android.mk @@ -658,6 +658,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ platform/graphics/android/SharedBufferStream.cpp \ platform/graphics/android/ShaderProgram.cpp \ platform/graphics/android/SharedTexture.cpp \ + platform/graphics/android/TextureInfo.cpp \ platform/graphics/android/TexturesGenerator.cpp \ platform/graphics/android/TilesManager.cpp \ platform/graphics/android/TiledPage.cpp \ diff --git a/Source/WebCore/platform/graphics/android/BaseTile.h b/Source/WebCore/platform/graphics/android/BaseTile.h index 03b96ce..a48378b 100644 --- a/Source/WebCore/platform/graphics/android/BaseTile.h +++ b/Source/WebCore/platform/graphics/android/BaseTile.h @@ -30,7 +30,7 @@ #include "HashMap.h" #include "PerformanceMonitor.h" -#include "SharedTexture.h" +#include "TextureInfo.h" #include "SkBitmap.h" #include "SkCanvas.h" #include "SkRect.h" diff --git a/Source/WebCore/platform/graphics/android/SharedTexture.cpp b/Source/WebCore/platform/graphics/android/SharedTexture.cpp index 040a28a..829cdcf 100644 --- a/Source/WebCore/platform/graphics/android/SharedTexture.cpp +++ b/Source/WebCore/platform/graphics/android/SharedTexture.cpp @@ -34,33 +34,6 @@ namespace WebCore { -TextureInfo::TextureInfo() -{ - m_textureId = GL_NO_TEXTURE; - m_width = 0; - m_height = 0; - m_internalFormat = 0; -} - -bool TextureInfo::equalsAttributes(const TextureInfo* otherTexture) -{ - return otherTexture->m_width == m_width - && otherTexture->m_height == m_height - && otherTexture->m_internalFormat == m_internalFormat; -} - -void TextureInfo::copyAttributes(const TextureInfo* sourceTexture) -{ - m_width = sourceTexture->m_width; - m_height = sourceTexture->m_height; - m_internalFormat = sourceTexture->m_internalFormat; -} - -bool TextureInfo::operator==(const TextureInfo& otherTexture) -{ - return otherTexture.m_textureId == m_textureId && equalsAttributes(&otherTexture); -} - SharedTexture::SharedTexture() { m_eglImage = EGL_NO_IMAGE_KHR; diff --git a/Source/WebCore/platform/graphics/android/SharedTexture.h b/Source/WebCore/platform/graphics/android/SharedTexture.h index 37d6091..376eeb3 100644 --- a/Source/WebCore/platform/graphics/android/SharedTexture.h +++ b/Source/WebCore/platform/graphics/android/SharedTexture.h @@ -26,6 +26,7 @@ #ifndef SharedTexture_h #define SharedTexture_h +#include "TextureInfo.h" #include <EGL/egl.h> #include <EGL/eglext.h> #include <GLES2/gl2.h> @@ -34,28 +35,6 @@ namespace WebCore { -static const GLuint GL_NO_TEXTURE = 0; - -/** - * TextureInfo is a class that stores both the texture and metadata about the - * texture. - */ -class TextureInfo { -public: - - TextureInfo(); - - bool equalsAttributes(const TextureInfo* otherTexture); - void copyAttributes(const TextureInfo* sourceTexture); - - bool operator==(const TextureInfo& otherTexture); - - GLuint m_textureId; - int32_t m_width; - int32_t m_height; - GLenum m_internalFormat; -}; - /** * SharedTexture is a class that encapsulates all the necessary variables * needed to share a single texture across threads. In the case that threads diff --git a/Source/WebCore/platform/graphics/android/TextureInfo.cpp b/Source/WebCore/platform/graphics/android/TextureInfo.cpp new file mode 100644 index 0000000..2db1667 --- /dev/null +++ b/Source/WebCore/platform/graphics/android/TextureInfo.cpp @@ -0,0 +1,57 @@ +/* + * Copyright 2011, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "TextureInfo.h" + +namespace WebCore { + +TextureInfo::TextureInfo() +{ + m_textureId = GL_NO_TEXTURE; + m_width = 0; + m_height = 0; + m_internalFormat = 0; +} + +bool TextureInfo::equalsAttributes(const TextureInfo* otherTexture) +{ + return otherTexture->m_width == m_width + && otherTexture->m_height == m_height + && otherTexture->m_internalFormat == m_internalFormat; +} + +void TextureInfo::copyAttributes(const TextureInfo* sourceTexture) +{ + m_width = sourceTexture->m_width; + m_height = sourceTexture->m_height; + m_internalFormat = sourceTexture->m_internalFormat; +} + +bool TextureInfo::operator==(const TextureInfo& otherTexture) +{ + return otherTexture.m_textureId == m_textureId && equalsAttributes(&otherTexture); +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/graphics/android/TextureInfo.h b/Source/WebCore/platform/graphics/android/TextureInfo.h new file mode 100644 index 0000000..9ed6719 --- /dev/null +++ b/Source/WebCore/platform/graphics/android/TextureInfo.h @@ -0,0 +1,57 @@ +/* + * Copyright 2011, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TextureInfo_h +#define TextureInfo_h + +#include <GLES2/gl2.h> + +namespace WebCore { + +static const GLuint GL_NO_TEXTURE = 0; +/** + * TextureInfo is a class that stores both the texture and metadata about the + * texture. + */ +class TextureInfo { +public: + + TextureInfo(); + + bool equalsAttributes(const TextureInfo* otherTexture); + void copyAttributes(const TextureInfo* sourceTexture); + + bool operator==(const TextureInfo& otherTexture); + + GLuint m_textureId; + int32_t m_width; + int32_t m_height; + GLenum m_internalFormat; + +}; + +} // namespace WebCore + +#endif // TextureInfo_h |