OLD | NEW |
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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 if (texture_mailbox.sync_point()) | 239 if (texture_mailbox.sync_point()) |
240 gl->WaitSyncPointCHROMIUM(texture_mailbox.sync_point()); | 240 gl->WaitSyncPointCHROMIUM(texture_mailbox.sync_point()); |
241 | 241 |
242 GLuint texture_id = 0; | 242 GLuint texture_id = 0; |
243 gl->GenTextures(1, &texture_id); | 243 gl->GenTextures(1, &texture_id); |
244 gl->BindTexture(GL_TEXTURE_2D, texture_id); | 244 gl->BindTexture(GL_TEXTURE_2D, texture_id); |
245 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 245 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
246 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 246 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
247 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 247 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
248 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 248 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
249 gl->ConsumeTextureCHROMIUM(texture_mailbox.target(), texture_mailbox.data()); | 249 gl->ConsumeTextureCHROMIUM(texture_mailbox.target(), |
| 250 texture_mailbox.mailbox().name); |
250 gl->BindTexture(GL_TEXTURE_2D, 0); | 251 gl->BindTexture(GL_TEXTURE_2D, 0); |
251 | 252 |
252 GLuint fbo = 0; | 253 GLuint fbo = 0; |
253 gl->GenFramebuffers(1, &fbo); | 254 gl->GenFramebuffers(1, &fbo); |
254 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); | 255 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); |
255 gl->FramebufferTexture2D( | 256 gl->FramebufferTexture2D( |
256 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0); | 257 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0); |
257 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE), | 258 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE), |
258 gl->CheckFramebufferStatus(GL_FRAMEBUFFER)); | 259 gl->CheckFramebufferStatus(GL_FRAMEBUFFER)); |
259 | 260 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 GL_UNSIGNED_BYTE, | 362 GL_UNSIGNED_BYTE, |
362 gl_pixels.get()); | 363 gl_pixels.get()); |
363 } | 364 } |
364 | 365 |
365 gpu::Mailbox mailbox; | 366 gpu::Mailbox mailbox; |
366 gl->GenMailboxCHROMIUM(mailbox.name); | 367 gl->GenMailboxCHROMIUM(mailbox.name); |
367 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 368 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
368 gl->BindTexture(GL_TEXTURE_2D, 0); | 369 gl->BindTexture(GL_TEXTURE_2D, 0); |
369 uint32 sync_point = gl->InsertSyncPointCHROMIUM(); | 370 uint32 sync_point = gl->InsertSyncPointCHROMIUM(); |
370 | 371 |
371 *texture_mailbox = TextureMailbox(mailbox, sync_point); | 372 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
372 *release_callback = SingleReleaseCallback::Create( | 373 *release_callback = SingleReleaseCallback::Create( |
373 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 374 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
374 base::Unretained(this), | 375 base::Unretained(this), |
375 base::Passed(&context), | 376 base::Passed(&context), |
376 texture_id)); | 377 texture_id)); |
377 } | 378 } |
378 | 379 |
379 } // namespace cc | 380 } // namespace cc |
OLD | NEW |