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

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

Issue 132233041: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ff7262fa 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
« no previous file with comments | « cc/test/fake_delegated_renderer_layer_impl.cc ('k') | cc/trees/layer_tree_host_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 if (texture_mailbox.sync_point()) 240 if (texture_mailbox.sync_point())
241 gl->WaitSyncPointCHROMIUM(texture_mailbox.sync_point()); 241 gl->WaitSyncPointCHROMIUM(texture_mailbox.sync_point());
242 242
243 GLuint texture_id = 0; 243 GLuint texture_id = 0;
244 gl->GenTextures(1, &texture_id); 244 gl->GenTextures(1, &texture_id);
245 gl->BindTexture(GL_TEXTURE_2D, texture_id); 245 gl->BindTexture(GL_TEXTURE_2D, texture_id);
246 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 246 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
247 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 247 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
248 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 248 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
249 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 249 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
250 gl->ConsumeTextureCHROMIUM(texture_mailbox.target(), texture_mailbox.data()); 250 gl->ConsumeTextureCHROMIUM(texture_mailbox.target(), texture_mailbox.name());
251 gl->BindTexture(GL_TEXTURE_2D, 0); 251 gl->BindTexture(GL_TEXTURE_2D, 0);
252 252
253 GLuint fbo = 0; 253 GLuint fbo = 0;
254 gl->GenFramebuffers(1, &fbo); 254 gl->GenFramebuffers(1, &fbo);
255 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); 255 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo);
256 gl->FramebufferTexture2D( 256 gl->FramebufferTexture2D(
257 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0); 257 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0);
258 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE), 258 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE),
259 gl->CheckFramebufferStatus(GL_FRAMEBUFFER)); 259 gl->CheckFramebufferStatus(GL_FRAMEBUFFER));
260 260
(...skipping 101 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 gl->GenMailboxCHROMIUM(mailbox.name); 367 gl->GenMailboxCHROMIUM(mailbox.name);
368 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 368 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
369 gl->BindTexture(GL_TEXTURE_2D, 0); 369 gl->BindTexture(GL_TEXTURE_2D, 0);
370 uint32 sync_point = gl->InsertSyncPointCHROMIUM(); 370 uint32 sync_point = gl->InsertSyncPointCHROMIUM();
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(&context), 376 base::Passed(&context),
377 texture_id)); 377 texture_id));
378 } 378 }
379 379
380 } // namespace cc 380 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_delegated_renderer_layer_impl.cc ('k') | cc/trees/layer_tree_host_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698