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(), texture_mailbox.name()); |
250 gl->BindTexture(GL_TEXTURE_2D, 0); | 250 gl->BindTexture(GL_TEXTURE_2D, 0); |
251 | 251 |
252 GLuint fbo = 0; | 252 GLuint fbo = 0; |
253 gl->GenFramebuffers(1, &fbo); | 253 gl->GenFramebuffers(1, &fbo); |
254 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); | 254 gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); |
255 gl->FramebufferTexture2D( | 255 gl->FramebufferTexture2D( |
256 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0); | 256 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0); |
257 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE), | 257 EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE), |
258 gl->CheckFramebufferStatus(GL_FRAMEBUFFER)); | 258 gl->CheckFramebufferStatus(GL_FRAMEBUFFER)); |
259 | 259 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 GL_UNSIGNED_BYTE, | 361 GL_UNSIGNED_BYTE, |
362 gl_pixels.get()); | 362 gl_pixels.get()); |
363 } | 363 } |
364 | 364 |
365 gpu::Mailbox mailbox; | 365 gpu::Mailbox mailbox; |
366 gl->GenMailboxCHROMIUM(mailbox.name); | 366 gl->GenMailboxCHROMIUM(mailbox.name); |
367 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 367 gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
368 gl->BindTexture(GL_TEXTURE_2D, 0); | 368 gl->BindTexture(GL_TEXTURE_2D, 0); |
369 uint32 sync_point = gl->InsertSyncPointCHROMIUM(); | 369 uint32 sync_point = gl->InsertSyncPointCHROMIUM(); |
370 | 370 |
371 *texture_mailbox = TextureMailbox(mailbox, sync_point); | 371 *texture_mailbox = TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); |
372 *release_callback = SingleReleaseCallback::Create( | 372 *release_callback = SingleReleaseCallback::Create( |
373 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, | 373 base::Bind(&LayerTreePixelTest::ReleaseTextureMailbox, |
374 base::Unretained(this), | 374 base::Unretained(this), |
375 base::Passed(&context), | 375 base::Passed(&context), |
376 texture_id)); | 376 texture_id)); |
377 } | 377 } |
378 | 378 |
379 } // namespace cc | 379 } // namespace cc |
OLD | NEW |