summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-06-06 17:12:56 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-06-07 10:00:27 -0700
commiteb40b62c73237c78ff48b131dd9eeb5871c0cc38 (patch)
treec6e22e842407f3cd4506135024a9849a3b00f019 /Source
parentdfadaafc15c16563aba837f05c778eaa2a433a8b (diff)
downloadexternal_webkit-eb40b62c73237c78ff48b131dd9eeb5871c0cc38.zip
external_webkit-eb40b62c73237c78ff48b131dd9eeb5871c0cc38.tar.gz
external_webkit-eb40b62c73237c78ff48b131dd9eeb5871c0cc38.tar.bz2
refactor the TextureInfo out from SharedTexture, no functional change
Change-Id: I9018a8079da1df2fd55c94aacd4ae96227ad2bd2
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/Android.mk1
-rw-r--r--Source/WebCore/platform/graphics/android/BaseTile.h2
-rw-r--r--Source/WebCore/platform/graphics/android/SharedTexture.cpp27
-rw-r--r--Source/WebCore/platform/graphics/android/SharedTexture.h23
-rw-r--r--Source/WebCore/platform/graphics/android/TextureInfo.cpp57
-rw-r--r--Source/WebCore/platform/graphics/android/TextureInfo.h57
6 files changed, 117 insertions, 50 deletions
diff --git a/Source/WebCore/Android.mk b/Source/WebCore/Android.mk
index b2ad8f4..bcd8c7d 100644
--- a/Source/WebCore/Android.mk
+++ b/Source/WebCore/Android.mk
@@ -651,6 +651,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