Index: cc/resource_provider_unittest.cc |
diff --git a/cc/resource_provider_unittest.cc b/cc/resource_provider_unittest.cc |
index 5d387f725a273236d72ac44078cbe34767271648..7c6dc37b5c1c469d0f1e1d483538e8a839d9c424 100644 |
--- a/cc/resource_provider_unittest.cc |
+++ b/cc/resource_provider_unittest.cc |
@@ -8,13 +8,14 @@ |
#include "CCGraphicsContext.h" |
#include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread |
-#include "Extensions3DChromium.h" |
#include "base/logging.h" |
#include "cc/scoped_ptr_deque.h" |
#include "cc/scoped_ptr_hash_map.h" |
#include "cc/test/compositor_fake_web_graphics_context_3d.h" |
#include "cc/test/fake_web_compositor_output_surface.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "third_party/khronos/GLES2/gl2.h" |
+#include "third_party/khronos/GLES2/gl2ext.h" |
#include <public/WebGraphicsContext3D.h> |
using namespace cc; |
@@ -116,7 +117,7 @@ public: |
virtual void bindTexture(WGC3Denum target, WebGLId texture) |
{ |
- ASSERT_EQ(target, GraphicsContext3D::TEXTURE_2D); |
+ ASSERT_EQ(target, GL_TEXTURE_2D); |
ASSERT_TRUE(!texture || m_textures.find(texture) != m_textures.end()); |
m_currentTexture = texture; |
} |
@@ -141,14 +142,14 @@ public: |
WGC3Dint width, WGC3Dint height) |
{ |
ASSERT_TRUE(m_currentTexture); |
- ASSERT_EQ(target, GraphicsContext3D::TEXTURE_2D); |
+ ASSERT_EQ(target, GL_TEXTURE_2D); |
ASSERT_EQ(levels, 1); |
- WGC3Denum format = GraphicsContext3D::RGBA; |
+ WGC3Denum format = GL_RGBA; |
switch (internalformat) { |
- case Extensions3D::RGBA8_OES: |
+ case GL_RGBA8_OES: |
break; |
- case Extensions3DChromium::BGRA8_EXT: |
- format = Extensions3D::BGRA_EXT; |
+ case GL_BGRA8_EXT: |
+ format = GL_BGRA_EXT; |
break; |
default: |
NOTREACHED(); |
@@ -159,11 +160,11 @@ public: |
virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) |
{ |
ASSERT_TRUE(m_currentTexture); |
- ASSERT_EQ(target, GraphicsContext3D::TEXTURE_2D); |
+ ASSERT_EQ(target, GL_TEXTURE_2D); |
ASSERT_FALSE(level); |
ASSERT_EQ(internalformat, format); |
ASSERT_FALSE(border); |
- ASSERT_EQ(type, GraphicsContext3D::UNSIGNED_BYTE); |
+ ASSERT_EQ(type, GL_UNSIGNED_BYTE); |
allocateTexture(IntSize(width, height), format); |
if (pixels) |
setPixels(0, 0, width, height, pixels); |
@@ -172,11 +173,11 @@ public: |
virtual void texSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, const void* pixels) |
{ |
ASSERT_TRUE(m_currentTexture); |
- ASSERT_EQ(target, GraphicsContext3D::TEXTURE_2D); |
+ ASSERT_EQ(target, GL_TEXTURE_2D); |
ASSERT_FALSE(level); |
ASSERT_TRUE(m_textures.get(m_currentTexture)); |
ASSERT_EQ(m_textures.get(m_currentTexture)->format, format); |
- ASSERT_EQ(type, GraphicsContext3D::UNSIGNED_BYTE); |
+ ASSERT_EQ(type, GL_UNSIGNED_BYTE); |
ASSERT_TRUE(pixels); |
setPixels(xoffset, yoffset, width, height, pixels); |
} |
@@ -185,7 +186,7 @@ public: |
virtual void produceTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) |
{ |
ASSERT_TRUE(m_currentTexture); |
- ASSERT_EQ(target, GraphicsContext3D::TEXTURE_2D); |
+ ASSERT_EQ(target, GL_TEXTURE_2D); |
// Delay moving the texture into the mailbox until the next |
// insertSyncPoint, so that it is not visible to other contexts that |
@@ -200,7 +201,7 @@ public: |
virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) |
{ |
ASSERT_TRUE(m_currentTexture); |
- ASSERT_EQ(target, GraphicsContext3D::TEXTURE_2D); |
+ ASSERT_EQ(target, GL_TEXTURE_2D); |
m_textures.set(m_currentTexture, m_sharedData->consumeTexture(mailbox, m_lastWaitedSyncPoint)); |
} |
@@ -283,7 +284,7 @@ public: |
if (GetParam() == CCResourceProvider::GLTexture) { |
CCResourceProvider::ScopedReadLockGL lockGL(m_resourceProvider.get(), id); |
ASSERT_NE(0U, lockGL.textureId()); |
- context()->bindTexture(GraphicsContext3D::TEXTURE_2D, lockGL.textureId()); |
+ context()->bindTexture(GL_TEXTURE_2D, lockGL.textureId()); |
context()->getPixels(size, format, pixels); |
} else if (GetParam() == CCResourceProvider::Bitmap) { |
CCResourceProvider::ScopedReadLockSoftware lockSoftware(m_resourceProvider.get(), id); |
@@ -308,7 +309,7 @@ protected: |
TEST_P(CCResourceProviderTest, Basic) |
{ |
IntSize size(1, 1); |
- WGC3Denum format = GraphicsContext3D::RGBA; |
+ WGC3Denum format = GL_RGBA; |
int pool = 1; |
size_t pixelSize = textureSize(size, format); |
ASSERT_EQ(4U, pixelSize); |
@@ -331,7 +332,7 @@ TEST_P(CCResourceProviderTest, Basic) |
TEST_P(CCResourceProviderTest, DeleteOwnedResources) |
{ |
IntSize size(1, 1); |
- WGC3Denum format = GraphicsContext3D::RGBA; |
+ WGC3Denum format = GL_RGBA; |
int pool = 1; |
const int count = 3; |
@@ -349,7 +350,7 @@ TEST_P(CCResourceProviderTest, DeleteOwnedResources) |
TEST_P(CCResourceProviderTest, Upload) |
{ |
IntSize size(2, 2); |
- WGC3Denum format = GraphicsContext3D::RGBA; |
+ WGC3Denum format = GL_RGBA; |
int pool = 1; |
size_t pixelSize = textureSize(size, format); |
ASSERT_EQ(16U, pixelSize); |
@@ -420,7 +421,7 @@ TEST_P(CCResourceProviderTest, TransferResources) |
scoped_ptr<CCResourceProvider> childResourceProvider(CCResourceProvider::create(childContext.get())); |
IntSize size(1, 1); |
- WGC3Denum format = GraphicsContext3D::RGBA; |
+ WGC3Denum format = GL_RGBA; |
int pool = 1; |
size_t pixelSize = textureSize(size, format); |
ASSERT_EQ(4U, pixelSize); |
@@ -496,14 +497,14 @@ TEST_P(CCResourceProviderTest, TransferResources) |
{ |
CCResourceProvider::ScopedReadLockGL lock(childResourceProvider.get(), id1); |
ASSERT_NE(0U, lock.textureId()); |
- childContext3D->bindTexture(GraphicsContext3D::TEXTURE_2D, lock.textureId()); |
+ childContext3D->bindTexture(GL_TEXTURE_2D, lock.textureId()); |
childContext3D->getPixels(size, format, result); |
EXPECT_EQ(0, memcmp(data1, result, pixelSize)); |
} |
{ |
CCResourceProvider::ScopedReadLockGL lock(childResourceProvider.get(), id2); |
ASSERT_NE(0U, lock.textureId()); |
- childContext3D->bindTexture(GraphicsContext3D::TEXTURE_2D, lock.textureId()); |
+ childContext3D->bindTexture(GL_TEXTURE_2D, lock.textureId()); |
childContext3D->getPixels(size, format, result); |
EXPECT_EQ(0, memcmp(data2, result, pixelSize)); |
} |
@@ -537,7 +538,7 @@ TEST_P(CCResourceProviderTest, DeleteTransferredResources) |
scoped_ptr<CCResourceProvider> childResourceProvider(CCResourceProvider::create(childContext.get())); |
IntSize size(1, 1); |
- WGC3Denum format = GraphicsContext3D::RGBA; |
+ WGC3Denum format = GL_RGBA; |
int pool = 1; |
size_t pixelSize = textureSize(size, format); |
ASSERT_EQ(4U, pixelSize); |