Index: cc/resource_provider_unittest.cc |
diff --git a/cc/resource_provider_unittest.cc b/cc/resource_provider_unittest.cc |
index ac9176ca3c3a0bdac3882ac5849ac3d7bb3bed1e..2822553259d67ffa57ef47aad4df836554f11f83 100644 |
--- a/cc/resource_provider_unittest.cc |
+++ b/cc/resource_provider_unittest.cc |
@@ -6,12 +6,12 @@ |
#include "CCResourceProvider.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+#include "third_party/khronos/GLES2/gl2ext.h" |
#include "CCGraphicsContext.h" |
#include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread |
#include "CompositorFakeWebGraphicsContext3D.h" |
-#include "Extensions3DChromium.h" |
#include "FakeWebCompositorOutputSurface.h" |
-#include "testing/gtest/include/gtest/gtest.h" |
#include <public/WebGraphicsContext3D.h> |
#include <wtf/HashMap.h> |
#include <wtf/OwnArrayPtr.h> |
@@ -116,7 +116,7 @@ public: |
virtual void bindTexture(WGC3Denum target, WebGLId texture) |
{ |
- ASSERT(target == GraphicsContext3D::TEXTURE_2D); |
+ ASSERT(target == GL_TEXTURE_2D); |
ASSERT(!texture || m_textures.find(texture) != m_textures.end()); |
m_currentTexture = texture; |
} |
@@ -141,14 +141,14 @@ public: |
WGC3Dint width, WGC3Dint height) |
{ |
ASSERT(m_currentTexture); |
- ASSERT(target == GraphicsContext3D::TEXTURE_2D); |
+ ASSERT(target == GL_TEXTURE_2D); |
ASSERT(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: |
ASSERT_NOT_REACHED(); |
@@ -159,11 +159,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(m_currentTexture); |
- ASSERT(target == GraphicsContext3D::TEXTURE_2D); |
+ ASSERT(target == GL_TEXTURE_2D); |
ASSERT(!level); |
ASSERT(internalformat == format); |
ASSERT(!border); |
- ASSERT(type == GraphicsContext3D::UNSIGNED_BYTE); |
+ ASSERT(type == GL_UNSIGNED_BYTE); |
allocateTexture(IntSize(width, height), format); |
if (pixels) |
setPixels(0, 0, width, height, pixels); |
@@ -172,11 +172,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(m_currentTexture); |
- ASSERT(target == GraphicsContext3D::TEXTURE_2D); |
+ ASSERT(target == GL_TEXTURE_2D); |
ASSERT(!level); |
ASSERT(m_textures.get(m_currentTexture)); |
ASSERT(m_textures.get(m_currentTexture)->format == format); |
- ASSERT(type == GraphicsContext3D::UNSIGNED_BYTE); |
+ ASSERT(type == GL_UNSIGNED_BYTE); |
ASSERT(pixels); |
setPixels(xoffset, yoffset, width, height, pixels); |
} |
@@ -185,7 +185,7 @@ public: |
virtual void produceTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) |
{ |
ASSERT(m_currentTexture); |
- ASSERT(target == GraphicsContext3D::TEXTURE_2D); |
+ ASSERT(target == GL_TEXTURE_2D); |
// Delay movind the texture into the mailbox until the next |
// insertSyncPoint, so that it is not visible to other contexts that |
@@ -200,7 +200,7 @@ public: |
virtual void consumeTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox) |
{ |
ASSERT(m_currentTexture); |
- ASSERT(target == GraphicsContext3D::TEXTURE_2D); |
+ ASSERT(target == GL_TEXTURE_2D); |
m_textures.set(m_currentTexture, m_sharedData->consumeTexture(mailbox, m_lastWaitedSyncPoint)); |
} |
@@ -283,7 +283,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 +308,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 +331,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 +349,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 +420,7 @@ TEST_P(CCResourceProviderTest, TransferResources) |
OwnPtr<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 +496,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 +537,7 @@ TEST_P(CCResourceProviderTest, DeleteTransferredResources) |
OwnPtr<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); |