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

Side by Side Diff: cc/test/layer_tree_pixel_test.cc

Issue 105743004: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cc2a95fe Android fixes. Created 7 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/test/layer_tree_pixel_test.h" 5 #include "cc/test/layer_tree_pixel_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "cc/base/switches.h" 9 #include "cc/base/switches.h"
10 #include "cc/layers/solid_color_layer.h" 10 #include "cc/layers/solid_color_layer.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 unsigned texture_id = context3d->createTexture(); 235 unsigned texture_id = context3d->createTexture();
236 context3d->bindTexture(GL_TEXTURE_2D, texture_id); 236 context3d->bindTexture(GL_TEXTURE_2D, texture_id);
237 context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 237 context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
238 context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 238 context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
239 context3d->texParameteri( 239 context3d->texParameteri(
240 GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 240 GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
241 context3d->texParameteri( 241 context3d->texParameteri(
242 GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 242 GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
243 context3d->consumeTextureCHROMIUM(texture_mailbox.target(), 243 context3d->consumeTextureCHROMIUM(texture_mailbox.target(),
244 texture_mailbox.data()); 244 texture_mailbox.mailbox().name);
245 context3d->bindTexture(GL_TEXTURE_2D, 0); 245 context3d->bindTexture(GL_TEXTURE_2D, 0);
246 246
247 unsigned fbo = context3d->createFramebuffer(); 247 unsigned fbo = context3d->createFramebuffer();
248 context3d->bindFramebuffer(GL_FRAMEBUFFER, fbo); 248 context3d->bindFramebuffer(GL_FRAMEBUFFER, fbo);
249 context3d->framebufferTexture2D(GL_FRAMEBUFFER, 249 context3d->framebufferTexture2D(GL_FRAMEBUFFER,
250 GL_COLOR_ATTACHMENT0, 250 GL_COLOR_ATTACHMENT0,
251 GL_TEXTURE_2D, 251 GL_TEXTURE_2D,
252 texture_id, 252 texture_id,
253 0); 253 0);
254 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE), 254 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE),
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 GL_UNSIGNED_BYTE, 362 GL_UNSIGNED_BYTE,
363 gl_pixels.get()); 363 gl_pixels.get());
364 } 364 }
365 365
366 gpu::Mailbox mailbox; 366 gpu::Mailbox mailbox;
367 context3d->genMailboxCHROMIUM(mailbox.name); 367 context3d->genMailboxCHROMIUM(mailbox.name);
368 context3d->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 368 context3d->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
369 context3d->bindTexture(GL_TEXTURE_2D, 0); 369 context3d->bindTexture(GL_TEXTURE_2D, 0);
370 uint32 sync_point = context3d->insertSyncPoint(); 370 uint32 sync_point = context3d->insertSyncPoint();
371 371
372 *texture_mailbox = TextureMailbox(mailbox, sync_point); 372 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point);
373 *release_callback = SingleReleaseCallback::Create( 373 *release_callback = SingleReleaseCallback::Create(
374 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, 374 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox,
375 base::Unretained(this), 375 base::Unretained(this),
376 base::Passed(&context3d), 376 base::Passed(&context3d),
377 texture_id)); 377 texture_id));
378 } 378 }
379 379
380 } // namespace cc 380 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698