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

Unified Diff: cc/resources/texture_uploader_unittest.cc

Issue 735493003: cc: Added RED_8 to the ResourceFormat enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« cc/resources/resource_format.h ('K') | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/texture_uploader_unittest.cc
diff --git a/cc/resources/texture_uploader_unittest.cc b/cc/resources/texture_uploader_unittest.cc
index 7249172729148920d5b3ef517d9924868f8dabac..b1689627d1f32bbd0a7aed726e935bedf2cb9c74 100644
--- a/cc/resources/texture_uploader_unittest.cc
+++ b/cc/resources/texture_uploader_unittest.cc
@@ -111,6 +111,14 @@ class TextureUploadTestContext : public gpu::gles2::GLES2InterfaceStub {
EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type);
bytes_per_pixel = 2;
break;
+ case GL_RED_EXT:
+ EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type);
+ bytes_per_pixel = 1;
+ break;
+ case GL_RG_EXT:
reveman 2014/11/27 04:07:09 nit: are we using GL_RG_EXT? please remove if not
+ EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type);
+ bytes_per_pixel = 2;
+ break;
}
// If NULL, we aren't checking texture contents.
@@ -232,6 +240,15 @@ TEST(TextureUploaderTest, UploadContentsTest) {
buffer[(i + 1) * 82 - 1] = 0x2;
}
UploadTexture(uploader.get(), LUMINANCE_8, gfx::Size(82, 86), buffer);
+
+ // Upload a tightly packed 82x86 RED texture.
+ memset(buffer, 0, sizeof(buffer));
+ for (int i = 0; i < 86; ++i) {
+ // Mark the beginning and end of each row, for the test.
+ buffer[i * 1 * 82] = 0x1;
+ buffer[(i + 1) * 82 - 1] = 0x2;
+ }
+ UploadTexture(uploader.get(), RED_8, gfx::Size(82, 86), buffer);
}
} // namespace
« cc/resources/resource_format.h ('K') | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698