Chromium Code Reviews| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap( | 221 scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap( |
| 222 const gfx::Size& size, | 222 const gfx::Size& size, |
| 223 const TextureMailbox& texture_mailbox) { | 223 const TextureMailbox& texture_mailbox) { |
| 224 DCHECK(texture_mailbox.IsTexture()); | 224 DCHECK(texture_mailbox.IsTexture()); |
| 225 if (!texture_mailbox.IsTexture()) | 225 if (!texture_mailbox.IsTexture()) |
| 226 return nullptr; | 226 return nullptr; |
| 227 | 227 |
| 228 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); | 228 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); |
| 229 GLES2Interface* gl = context->GetImplementation(); | 229 GLES2Interface* gl = context->GetImplementation(); |
| 230 | 230 |
| 231 if (texture_mailbox.sync_point()) | 231 if (texture_mailbox.sync_token().HasData()) |
| 232 gl->WaitSyncPointCHROMIUM(texture_mailbox.sync_point()); | 232 gl->WaitSyncTokenCHROMIUM(texture_mailbox.sync_token().GetConstData()); |
| 233 | 233 |
| 234 GLuint texture_id = 0; | 234 GLuint texture_id = 0; |
| 235 gl->GenTextures(1, &texture_id); | 235 gl->GenTextures(1, &texture_id); |
| 236 gl->BindTexture(GL_TEXTURE_2D, texture_id); | 236 gl->BindTexture(GL_TEXTURE_2D, texture_id); |
| 237 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 237 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 238 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 238 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
| 239 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 239 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 240 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 240 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 241 gl->ConsumeTextureCHROMIUM(texture_mailbox.target(), texture_mailbox.name()); | 241 gl->ConsumeTextureCHROMIUM(texture_mailbox.target(), texture_mailbox.name()); |
| 242 gl->BindTexture(GL_TEXTURE_2D, 0); | 242 gl->BindTexture(GL_TEXTURE_2D, 0); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 out_pixels[dest_y + x + SK_R32_SHIFT/8] = pixels.get()[src_y + x + 0]; | 276 out_pixels[dest_y + x + SK_R32_SHIFT/8] = pixels.get()[src_y + x + 0]; |
| 277 out_pixels[dest_y + x + SK_G32_SHIFT/8] = pixels.get()[src_y + x + 1]; | 277 out_pixels[dest_y + x + SK_G32_SHIFT/8] = pixels.get()[src_y + x + 1]; |
| 278 out_pixels[dest_y + x + SK_B32_SHIFT/8] = pixels.get()[src_y + x + 2]; | 278 out_pixels[dest_y + x + SK_B32_SHIFT/8] = pixels.get()[src_y + x + 2]; |
| 279 out_pixels[dest_y + x + SK_A32_SHIFT/8] = pixels.get()[src_y + x + 3]; | 279 out_pixels[dest_y + x + SK_A32_SHIFT/8] = pixels.get()[src_y + x + 3]; |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 | 282 |
| 283 return bitmap.Pass(); | 283 return bitmap.Pass(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
|
dcheng
2015/11/03 07:39:29
Revert these empty lines?
David Yen
2015/11/03 18:09:28
Done.
| |
| 286 void LayerTreePixelTest::Finish() { | 293 void LayerTreePixelTest::Finish() { |
| 287 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); | 294 scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext(); |
| 288 GLES2Interface* gl = context->GetImplementation(); | 295 GLES2Interface* gl = context->GetImplementation(); |
| 289 gl->Finish(); | 296 gl->Finish(); |
| 290 } | 297 } |
| 291 | 298 |
| 292 } // namespace cc | 299 } // namespace cc |
| OLD | NEW |