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

Side by Side Diff: gpu/command_buffer/tests/gl_texture_mailbox_unittest.cc

Issue 165393003: gpu: Generate mailboxes on client side (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 8
9 #include "gpu/command_buffer/client/gles2_lib.h" 9 #include "gpu/command_buffer/client/gles2_lib.h"
10 #include "gpu/command_buffer/common/mailbox.h" 10 #include "gpu/command_buffer/common/mailbox.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 0, 123 0,
124 GL_RGBA, 124 GL_RGBA,
125 1, 1, 125 1, 1,
126 0, 126 0,
127 GL_RGBA, 127 GL_RGBA,
128 GL_UNSIGNED_BYTE, 128 GL_UNSIGNED_BYTE,
129 &source_pixel); 129 &source_pixel);
130 130
131 GLbyte invalid_mailbox[GL_MAILBOX_SIZE_CHROMIUM]; 131 GLbyte invalid_mailbox[GL_MAILBOX_SIZE_CHROMIUM];
132 glGenMailboxCHROMIUM(invalid_mailbox); 132 glGenMailboxCHROMIUM(invalid_mailbox);
133 ++invalid_mailbox[GL_MAILBOX_SIZE_CHROMIUM - 1];
134 133
135 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 134 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
136 glConsumeTextureCHROMIUM(GL_TEXTURE_2D, invalid_mailbox); 135 glConsumeTextureCHROMIUM(GL_TEXTURE_2D, invalid_mailbox);
137 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_OPERATION), glGetError()); 136 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_OPERATION), glGetError());
138 137
139 // Ensure level 0 is still intact after glConsumeTextureCHROMIUM fails. 138 // Ensure level 0 is still intact after glConsumeTextureCHROMIUM fails.
140 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 139 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
141 EXPECT_EQ(source_pixel, ReadTexel(tex, 0, 0)); 140 EXPECT_EQ(source_pixel, ReadTexel(tex, 0, 0));
142 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 141 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
143 } 142 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 other_gl[i].Destroy(); 335 other_gl[i].Destroy();
337 } 336 }
338 337
339 gl1_.MakeCurrent(); 338 gl1_.MakeCurrent();
340 glDeleteTextures(2, tex); 339 glDeleteTextures(2, tex);
341 } 340 }
342 #endif 341 #endif
343 342
344 } // namespace gpu 343 } // namespace gpu
345 344
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698