Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: cc/resources/scoped_resource_unittest.cc

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a signed vs. unsigned comparison in video_resource_updater.cc Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/scoped_resource.cc ('k') | cc/resources/tile_manager_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/scoped_resource_unittest.cc
diff --git a/cc/resources/scoped_resource_unittest.cc b/cc/resources/scoped_resource_unittest.cc
index 9c66180df4e736db00a7ada427007353026ee811..8b59995f2897e3890de83b8855b9c5068da0515c 100644
--- a/cc/resources/scoped_resource_unittest.cc
+++ b/cc/resources/scoped_resource_unittest.cc
@@ -9,7 +9,6 @@
#include "cc/test/fake_output_surface_client.h"
#include "cc/test/tiled_layer_test_common.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/khronos/GLES2/gl2.h"
namespace cc {
namespace {
@@ -20,7 +19,7 @@ TEST(ScopedResourceTest, NewScopedResource) {
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));
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
@@ -38,18 +37,19 @@ TEST(ScopedResourceTest, CreateScopedResource) {
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));
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
- texture->Allocate(
- gfx::Size(30, 30), GL_RGBA, ResourceProvider::TextureUsageAny);
+ texture->Allocate(gfx::Size(30, 30),
+ ResourceProvider::TextureUsageAny,
+ RGBA_8888);
// The texture has an allocated byte-size now.
size_t expected_bytes = 30 * 30 * 4;
EXPECT_EQ(expected_bytes, texture->bytes());
EXPECT_LT(0u, texture->id());
- EXPECT_EQ(static_cast<unsigned>(GL_RGBA), texture->format());
+ EXPECT_EQ(static_cast<unsigned>(RGBA_8888), texture->format());
EXPECT_EQ(gfx::Size(30, 30), texture->size());
}
@@ -59,14 +59,15 @@ TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
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));
{
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
EXPECT_EQ(0u, resource_provider->num_resources());
- texture->Allocate(
- gfx::Size(30, 30), GL_RGBA, ResourceProvider::TextureUsageAny);
+ texture->Allocate(gfx::Size(30, 30),
+ ResourceProvider::TextureUsageAny,
+ RGBA_8888);
EXPECT_LT(0u, texture->id());
EXPECT_EQ(1u, resource_provider->num_resources());
}
@@ -76,8 +77,9 @@ TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
EXPECT_EQ(0u, resource_provider->num_resources());
- texture->Allocate(
- gfx::Size(30, 30), GL_RGBA, ResourceProvider::TextureUsageAny);
+ texture->Allocate(gfx::Size(30, 30),
+ ResourceProvider::TextureUsageAny,
+ RGBA_8888);
EXPECT_LT(0u, texture->id());
EXPECT_EQ(1u, resource_provider->num_resources());
texture->Free();
@@ -91,14 +93,15 @@ TEST(ScopedResourceTest, LeakScopedResource) {
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));
{
scoped_ptr<ScopedResource> texture =
ScopedResource::create(resource_provider.get());
EXPECT_EQ(0u, resource_provider->num_resources());
- texture->Allocate(
- gfx::Size(30, 30), GL_RGBA, ResourceProvider::TextureUsageAny);
+ texture->Allocate(gfx::Size(30, 30),
+ ResourceProvider::TextureUsageAny,
+ RGBA_8888);
EXPECT_LT(0u, texture->id());
EXPECT_EQ(1u, resource_provider->num_resources());
« no previous file with comments | « cc/resources/scoped_resource.cc ('k') | cc/resources/tile_manager_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698