| Index: cc/resources/resource_provider_unittest.cc
|
| diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc
|
| index afb233091d7656b739cc3362667eab1d13bab9aa..0d8f855ebabe7c785aceeabec910b882f6cadd63 100644
|
| --- a/cc/resources/resource_provider_unittest.cc
|
| +++ b/cc/resources/resource_provider_unittest.cc
|
| @@ -40,7 +40,7 @@ using WebKit::WebGLId;
|
| namespace cc {
|
| namespace {
|
|
|
| -size_t TextureSize(gfx::Size size, WGC3Denum format) {
|
| +size_t TextureSize(gfx::Size size, ResourceFormat format) {
|
| unsigned int components_per_pixel = 4;
|
| unsigned int bytes_per_component = 1;
|
| return size.width() * size.height() * components_per_pixel *
|
| @@ -64,16 +64,17 @@ class TextureStateTrackingContext : public TestWebGraphicsContext3D {
|
| };
|
|
|
| struct Texture : public base::RefCounted<Texture> {
|
| - Texture() : format(0), filter(GL_NEAREST_MIPMAP_LINEAR) {}
|
| + Texture() : format(RGBA_8888),
|
| + filter(GL_NEAREST_MIPMAP_LINEAR) {}
|
|
|
| - void Reallocate(gfx::Size size, WGC3Denum format) {
|
| + void Reallocate(gfx::Size size, ResourceFormat format) {
|
| this->size = size;
|
| this->format = format;
|
| this->data.reset(new uint8_t[TextureSize(size, format)]);
|
| }
|
|
|
| gfx::Size size;
|
| - WGC3Denum format;
|
| + ResourceFormat format;
|
| WGC3Denum filter;
|
| scoped_ptr<uint8_t[]> data;
|
|
|
| @@ -236,7 +237,9 @@ class ResourceProviderContext : public TestWebGraphicsContext3D {
|
| ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target);
|
| ASSERT_FALSE(level);
|
| ASSERT_TRUE(textures_[current_texture_].get());
|
| - ASSERT_EQ(textures_[current_texture_]->format, format);
|
| + ASSERT_EQ(
|
| + ResourceProvider::GetGLDataFormat(textures_[current_texture_]->format),
|
| + format);
|
| ASSERT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type);
|
| ASSERT_TRUE(pixels);
|
| SetPixels(xoffset, yoffset, width, height, pixels);
|
| @@ -279,7 +282,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D {
|
| mailbox, last_waited_sync_point_);
|
| }
|
|
|
| - void GetPixels(gfx::Size size, WGC3Denum format, uint8_t* pixels) {
|
| + void GetPixels(gfx::Size size, ResourceFormat format, uint8_t* pixels) {
|
| ASSERT_TRUE(current_texture_);
|
| scoped_refptr<Texture> texture = textures_[current_texture_];
|
| ASSERT_TRUE(texture.get());
|
| @@ -310,7 +313,16 @@ class ResourceProviderContext : public TestWebGraphicsContext3D {
|
| ASSERT_TRUE(current_texture_);
|
| scoped_refptr<Texture> texture = textures_[current_texture_];
|
| ASSERT_TRUE(texture.get());
|
| - texture->Reallocate(size, format);
|
| + ResourceFormat texture_format = RGBA_8888;
|
| + switch (format) {
|
| + case GL_RGBA:
|
| + texture_format = RGBA_8888;
|
| + break;
|
| + case GL_BGRA_EXT:
|
| + texture_format = BGRA_8888;
|
| + break;
|
| + }
|
| + texture->Reallocate(size, texture_format);
|
| }
|
|
|
| void SetPixels(int xoffset,
|
| @@ -355,7 +367,7 @@ void GetResourcePixels(ResourceProvider* resource_provider,
|
| ResourceProviderContext* context,
|
| ResourceProvider::ResourceId id,
|
| gfx::Size size,
|
| - WGC3Denum format,
|
| + ResourceFormat format,
|
| uint8_t* pixels) {
|
| switch (resource_provider->default_resource_type()) {
|
| case ResourceProvider::GLTexture: {
|
| @@ -407,7 +419,8 @@ class ResourceProviderTest
|
| break;
|
| }
|
| CHECK(output_surface_->BindToClient(&output_surface_client_));
|
| - resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0);
|
| + resource_provider_ = ResourceProvider::Create(
|
| + output_surface_.get(), 0, false);
|
| }
|
|
|
| static void SetResourceFilter(ResourceProvider* resource_provider,
|
| @@ -433,12 +446,12 @@ void CheckCreateResource(ResourceProvider::ResourceType expected_default_type,
|
| DCHECK_EQ(expected_default_type, resource_provider->default_resource_type());
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| size_t pixel_size = TextureSize(size, format);
|
| ASSERT_EQ(4U, pixel_size);
|
|
|
| ResourceProvider::ResourceId id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| EXPECT_EQ(1, static_cast<int>(resource_provider->num_resources()));
|
| if (expected_default_type == ResourceProvider::GLTexture)
|
| EXPECT_EQ(0, context->texture_count());
|
| @@ -465,12 +478,12 @@ TEST_P(ResourceProviderTest, Basic) {
|
|
|
| TEST_P(ResourceProviderTest, Upload) {
|
| gfx::Size size(2, 2);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| size_t pixel_size = TextureSize(size, format);
|
| ASSERT_EQ(16U, pixel_size);
|
|
|
| ResourceProvider::ResourceId id = resource_provider_->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
|
|
| uint8_t image[16] = { 0 };
|
| gfx::Rect image_rect(size);
|
| @@ -546,21 +559,21 @@ TEST_P(ResourceProviderTest, TransferResources) {
|
| CHECK(child_output_surface->BindToClient(&child_output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> child_resource_provider(
|
| - ResourceProvider::Create(child_output_surface.get(), 0));
|
| + ResourceProvider::Create(child_output_surface.get(), 0, false));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| size_t pixel_size = TextureSize(size, format);
|
| ASSERT_EQ(4U, pixel_size);
|
|
|
| ResourceProvider::ResourceId id1 = child_resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| uint8_t data1[4] = { 1, 2, 3, 4 };
|
| gfx::Rect rect(size);
|
| child_resource_provider->SetPixels(id1, data1, rect, rect, gfx::Vector2d());
|
|
|
| ResourceProvider::ResourceId id2 = child_resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| uint8_t data2[4] = { 5, 5, 5, 5 };
|
| child_resource_provider->SetPixels(id2, data2, rect, rect, gfx::Vector2d());
|
|
|
| @@ -682,15 +695,15 @@ TEST_P(ResourceProviderTest, DeleteTransferredResources) {
|
| CHECK(child_output_surface->BindToClient(&child_output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> child_resource_provider(
|
| - ResourceProvider::Create(child_output_surface.get(), 0));
|
| + ResourceProvider::Create(child_output_surface.get(), 0, false));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| size_t pixel_size = TextureSize(size, format);
|
| ASSERT_EQ(4U, pixel_size);
|
|
|
| ResourceProvider::ResourceId id = child_resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| uint8_t data[4] = { 1, 2, 3, 4 };
|
| gfx::Rect rect(size);
|
| child_resource_provider->SetPixels(id, data, rect, rect, gfx::Vector2d());
|
| @@ -743,7 +756,7 @@ class ResourceProviderTestTextureFilters : public ResourceProviderTest {
|
| CHECK(child_output_surface->BindToClient(&child_output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> child_resource_provider(
|
| - ResourceProvider::Create(child_output_surface.get(), 0));
|
| + ResourceProvider::Create(child_output_surface.get(), 0, false));
|
|
|
| scoped_ptr<TextureStateTrackingContext> parent_context_owned(
|
| new TextureStateTrackingContext);
|
| @@ -755,17 +768,17 @@ class ResourceProviderTestTextureFilters : public ResourceProviderTest {
|
| CHECK(parent_output_surface->BindToClient(&parent_output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> parent_resource_provider(
|
| - ResourceProvider::Create(parent_output_surface.get(), 0));
|
| + ResourceProvider::Create(parent_output_surface.get(), 0, false));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| int texture_id = 1;
|
|
|
| size_t pixel_size = TextureSize(size, format);
|
| ASSERT_EQ(4U, pixel_size);
|
|
|
| ResourceProvider::ResourceId id = child_resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
|
|
| // The new texture is created with GL_LINEAR.
|
| EXPECT_CALL(*child_context, bindTexture(GL_TEXTURE_2D, texture_id))
|
| @@ -942,7 +955,8 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) {
|
| context()->bindTexture(GL_TEXTURE_2D, other_texture);
|
| context()->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
|
| uint8_t test_data[4] = { 0 };
|
| - context()->GetPixels(gfx::Size(1, 1), GL_RGBA, test_data);
|
| + context()->GetPixels(
|
| + gfx::Size(1, 1), RGBA_8888, test_data);
|
| EXPECT_EQ(0, memcmp(data, test_data, sizeof(data)));
|
| context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
|
| context()->deleteTexture(other_texture);
|
| @@ -988,7 +1002,8 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) {
|
| context()->bindTexture(GL_TEXTURE_2D, other_texture);
|
| context()->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
|
| uint8_t test_data[4] = { 0 };
|
| - context()->GetPixels(gfx::Size(1, 1), GL_RGBA, test_data);
|
| + context()->GetPixels(
|
| + gfx::Size(1, 1), RGBA_8888, test_data);
|
| EXPECT_EQ(0, memcmp(data, test_data, sizeof(data)));
|
| context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
|
| context()->deleteTexture(other_texture);
|
| @@ -1161,14 +1176,14 @@ TEST_P(ResourceProviderTest, ScopedSampler) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| int texture_id = 1;
|
|
|
| ResourceProvider::ResourceId id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
|
|
| // Check that the texture gets created with the right sampler settings.
|
| EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id))
|
| @@ -1187,6 +1202,7 @@ TEST_P(ResourceProviderTest, ScopedSampler) {
|
| texParameteri(GL_TEXTURE_2D,
|
| GL_TEXTURE_POOL_CHROMIUM,
|
| GL_TEXTURE_POOL_UNMANAGED_CHROMIUM));
|
| +
|
| resource_provider->AllocateForTesting(id);
|
| Mock::VerifyAndClearExpectations(context);
|
|
|
| @@ -1241,15 +1257,15 @@ TEST_P(ResourceProviderTest, ManagedResource) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| int texture_id = 1;
|
|
|
| // Check that the texture gets created with the right sampler settings.
|
| ResourceProvider::ResourceId id = resource_provider->CreateManagedResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id));
|
| EXPECT_CALL(*context,
|
| texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
|
| @@ -1286,19 +1302,22 @@ TEST_P(ResourceProviderTest, TextureWrapMode) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| int texture_id = 1;
|
| GLenum texture_pool = GL_TEXTURE_POOL_UNMANAGED_CHROMIUM;
|
|
|
| for (int i = 0; i < 2; ++i) {
|
| GLint wrap_mode = i ? GL_CLAMP_TO_EDGE : GL_REPEAT;
|
| // Check that the texture gets created with the right sampler settings.
|
| - ResourceProvider::ResourceId id = resource_provider->CreateGLTexture(
|
| - size, format, texture_pool, wrap_mode,
|
| - ResourceProvider::TextureUsageAny);
|
| + ResourceProvider::ResourceId id =
|
| + resource_provider->CreateGLTexture(size,
|
| + texture_pool,
|
| + wrap_mode,
|
| + ResourceProvider::TextureUsageAny,
|
| + format);
|
| EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id));
|
| EXPECT_CALL(*context,
|
| texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
|
| @@ -1339,7 +1358,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_SharedMemory) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| TextureMailbox::ReleaseCallback callback = base::Bind(&EmptyReleaseCallback);
|
| TextureMailbox mailbox(shared_memory.get(), size, callback);
|
| @@ -1372,7 +1391,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTexture2D) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| unsigned texture_id = 1;
|
| unsigned sync_point = 30;
|
| @@ -1436,7 +1455,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTextureExternalOES) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| unsigned texture_id = 1;
|
| unsigned sync_point = 30;
|
| @@ -1557,19 +1576,19 @@ TEST_P(ResourceProviderTest, TextureAllocation) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| gfx::Size size(2, 2);
|
| gfx::Vector2d offset(0, 0);
|
| gfx::Rect rect(0, 0, 2, 2);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| ResourceProvider::ResourceId id = 0;
|
| uint8_t pixels[16] = { 0 };
|
| int texture_id = 123;
|
|
|
| // Lazy allocation. Don't allocate when creating the resource.
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
|
|
| EXPECT_CALL(*context, createTexture()).WillOnce(Return(texture_id));
|
| EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)).Times(1);
|
| @@ -1582,7 +1601,7 @@ TEST_P(ResourceProviderTest, TextureAllocation) {
|
|
|
| // Do allocate when we set the pixels.
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
|
|
| EXPECT_CALL(*context, createTexture()).WillOnce(Return(texture_id));
|
| EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)).Times(3);
|
| @@ -1597,7 +1616,7 @@ TEST_P(ResourceProviderTest, TextureAllocation) {
|
|
|
| // Same for async version.
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| resource_provider->AcquirePixelBuffer(id);
|
|
|
| EXPECT_CALL(*context, createTexture()).WillOnce(Return(texture_id));
|
| @@ -1628,15 +1647,15 @@ TEST_P(ResourceProviderTest, PixelBuffer_GLTexture) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| gfx::Size size(2, 2);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| ResourceProvider::ResourceId id = 0;
|
| int texture_id = 123;
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| resource_provider->AcquirePixelBuffer(id);
|
|
|
| EXPECT_CALL(*context, createTexture()).WillOnce(Return(texture_id));
|
| @@ -1665,15 +1684,15 @@ TEST_P(ResourceProviderTest, PixelBuffer_Bitmap) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| ResourceProvider::ResourceId id = 0;
|
| const uint32_t kBadBeef = 0xbadbeef;
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| resource_provider->AcquirePixelBuffer(id);
|
|
|
| void* data = resource_provider->MapPixelBuffer(id);
|
| @@ -1711,15 +1730,15 @@ TEST_P(ResourceProviderTest, ForcingAsyncUploadToComplete) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| gfx::Size size(2, 2);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| ResourceProvider::ResourceId id = 0;
|
| int texture_id = 123;
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| resource_provider->AcquirePixelBuffer(id);
|
|
|
| EXPECT_CALL(*context, createTexture()).WillOnce(Return(texture_id));
|
| @@ -1752,17 +1771,17 @@ TEST_P(ResourceProviderTest, PixelBufferLostContext) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| gfx::Size size(2, 2);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| ResourceProvider::ResourceId id = 0;
|
| int texture_id = 123;
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| EXPECT_CALL(*context, createTexture()).WillRepeatedly(Return(texture_id));
|
|
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| context->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
|
| GL_INNOCENT_CONTEXT_RESET_ARB);
|
| resource_provider->AcquirePixelBuffer(id);
|
| @@ -1789,16 +1808,16 @@ TEST_P(ResourceProviderTest, Image_GLTexture) {
|
| const int kWidth = 2;
|
| const int kHeight = 2;
|
| gfx::Size size(kWidth, kHeight);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| ResourceProvider::ResourceId id = 0;
|
| const unsigned kTextureId = 123u;
|
| const unsigned kImageId = 234u;
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| EXPECT_CALL(*context, createImageCHROMIUM(kWidth, kHeight, GL_RGBA8_OES))
|
| .WillOnce(Return(kImageId))
|
| .RetiresOnSaturation();
|
| @@ -1861,15 +1880,15 @@ TEST_P(ResourceProviderTest, Image_Bitmap) {
|
| CHECK(output_surface->BindToClient(&output_surface_client));
|
|
|
| gfx::Size size(1, 1);
|
| - WGC3Denum format = GL_RGBA;
|
| + ResourceFormat format = RGBA_8888;
|
| ResourceProvider::ResourceId id = 0;
|
| const uint32_t kBadBeef = 0xbadbeef;
|
|
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| id = resource_provider->CreateResource(
|
| - size, format, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny);
|
| + size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureUsageAny, format);
|
| resource_provider->AcquireImage(id);
|
|
|
| const int kStride = 0;
|
| @@ -1917,7 +1936,7 @@ TEST(ResourceProviderTest, BasicInitializeGLSoftware) {
|
| scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice)));
|
| EXPECT_TRUE(output_surface->BindToClient(&client));
|
| scoped_ptr<ResourceProvider> resource_provider(
|
| - ResourceProvider::Create(output_surface.get(), 0));
|
| + ResourceProvider::Create(output_surface.get(), 0, false));
|
|
|
| CheckCreateResource(ResourceProvider::Bitmap, resource_provider.get(), NULL);
|
|
|
|
|