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

Unified Diff: gpu/command_buffer/client/gles2_implementation_unittest.cc

Issue 10124016: Addition of GL_CHROMIUM_copy_texture extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removing dangling error checking code. Created 8 years, 8 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
Index: gpu/command_buffer/client/gles2_implementation_unittest.cc
===================================================================
--- gpu/command_buffer/client/gles2_implementation_unittest.cc (revision 132190)
+++ gpu/command_buffer/client/gles2_implementation_unittest.cc (working copy)
@@ -296,7 +296,7 @@
class GLES2ImplementationTest : public testing::Test {
protected:
static const uint8 kInitialValue = 0xBD;
- static const int32 kNumCommandEntries = 400;
+ static const int32 kNumCommandEntries = 500;
static const int32 kCommandBufferSizeBytes =
kNumCommandEntries * sizeof(CommandBufferEntry);
static const size_t kTransferBufferSize = 256;
@@ -1910,6 +1910,8 @@
pixels, mem1.ptr));
ClearCommands();
+ gl_->PixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, GL_TRUE);
+
ExpectedMemoryInfo mem2 = GetExpectedMemory(sizeof(pixels));
Cmds2 expected2;
expected2.tex_image_2d.Init(
@@ -1917,7 +1919,6 @@
mem2.id, mem2.offset);
expected2.set_token.Init(GetNextToken());
const void* commands2 = GetPut();
- gl_->PixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, GL_TRUE);
gl_->TexImage2D(
kTarget, kLevel, kFormat, kWidth, kHeight, kBorder, kFormat, kType,
pixels);
@@ -1997,6 +1998,7 @@
pixels.get() + kHeight / 2 * padded_row_size, mem2.ptr));
ClearCommands();
+ gl_->PixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, GL_TRUE);
const void* commands2 = GetPut();
ExpectedMemoryInfo mem3 = GetExpectedMemory(half_size);
ExpectedMemoryInfo mem4 = GetExpectedMemory(half_size);
@@ -2020,7 +2022,6 @@
// GetExpectedTransferAddressFromOffsetAs<uint8>(offset3, half_size)))
// .RetiresOnSaturation();
- gl_->PixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, GL_TRUE);
gl_->TexImage2D(
kTarget, kLevel, kFormat, kWidth, kHeight, kBorder, kFormat, kType,
pixels.get());
@@ -2048,6 +2049,7 @@
struct Cmds {
PixelStorei pixel_store_i1;
TexImage2D tex_image_2d;
+ PixelStorei pixel_store_i2;
TexSubImage2D tex_sub_image_2d1;
cmd::SetToken set_token1;
TexSubImage2D tex_sub_image_2d2;
@@ -2067,6 +2069,7 @@
expected.tex_image_2d.Init(
kTarget, kLevel, kFormat, kTextureWidth, kTextureHeight, kBorder, kFormat,
kType, 0, 0);
+ expected.pixel_store_i2.Init(GL_UNPACK_FLIP_Y_CHROMIUM, GL_TRUE);
expected.tex_sub_image_2d1.Init(kTarget, kLevel, kSubImageXOffset,
kSubImageYOffset + 2, kSubImageWidth, 2, kFormat, kType,
mem1.id, mem1.offset, false);
@@ -2080,12 +2083,11 @@
gl_->TexImage2D(
kTarget, kLevel, kFormat, kTextureWidth, kTextureHeight, kBorder, kFormat,
kType, NULL);
- // this call should not emit commands (handled client-side)
gl_->PixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, GL_TRUE);
scoped_array<uint32> pixels(new uint32[kSubImageWidth * kSubImageHeight]);
for (int y = 0; y < kSubImageHeight; ++y) {
for (int x = 0; x < kSubImageWidth; ++x) {
- pixels.get()[kSubImageWidth * y + x] = x | (y << 16);
+ pixels.get()[kSubImageWidth * y + x] = x | (y << 16);
}
}
gl_->TexSubImage2D(
@@ -2125,11 +2127,13 @@
struct {
PixelStorei pixel_store_i;
+ PixelStorei pixel_store_i2;
TexImage2D tex_image_2d;
} texImageExpected;
struct {
PixelStorei pixel_store_i;
+ PixelStorei pixel_store_i2;
TexImage2D tex_image_2d;
TexSubImage2D tex_sub_image_2d;
} texSubImageExpected;
@@ -2172,6 +2176,8 @@
src_pixels.get());
texSubImageExpected.pixel_store_i.Init(
GL_UNPACK_ALIGNMENT, alignment);
+ texSubImageExpected.pixel_store_i2.Init(
+ GL_UNPACK_FLIP_Y_CHROMIUM, flip_y);
texSubImageExpected.tex_image_2d.Init(
GL_TEXTURE_2D, kLevel, kFormat, kTexWidth, kTexHeight, kBorder,
kFormat, kType, 0, 0);
@@ -2187,6 +2193,8 @@
kSrcSubImageWidth, kSrcSubImageHeight, kBorder, kFormat, kType,
src_pixels.get());
texImageExpected.pixel_store_i.Init(GL_UNPACK_ALIGNMENT, alignment);
+ texImageExpected.pixel_store_i2.Init(
+ GL_UNPACK_FLIP_Y_CHROMIUM, flip_y);
texImageExpected.tex_image_2d.Init(
GL_TEXTURE_2D, kLevel, kFormat, kSrcSubImageWidth,
kSrcSubImageHeight, kBorder, kFormat, kType, mem.id, mem.offset);

Powered by Google App Engine
This is Rietveld 408576698