| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/message_loop/message_loop_proxy.h" | 6 #include "base/message_loop/message_loop_proxy.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "content/browser/gpu/compositor_util.h" | 9 #include "content/browser/gpu/compositor_util.h" |
| 10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 EXPECT_EQ(expected_copy_from_compositing_surface_result_, result); | 422 EXPECT_EQ(expected_copy_from_compositing_surface_result_, result); |
| 423 if (!result) { | 423 if (!result) { |
| 424 quit_callback.Run(); | 424 quit_callback.Run(); |
| 425 return; | 425 return; |
| 426 } | 426 } |
| 427 | 427 |
| 428 const SkBitmap& expected_bitmap = | 428 const SkBitmap& expected_bitmap = |
| 429 expected_copy_from_compositing_surface_bitmap_; | 429 expected_copy_from_compositing_surface_bitmap_; |
| 430 EXPECT_EQ(expected_bitmap.width(), bitmap.width()); | 430 EXPECT_EQ(expected_bitmap.width(), bitmap.width()); |
| 431 EXPECT_EQ(expected_bitmap.height(), bitmap.height()); | 431 EXPECT_EQ(expected_bitmap.height(), bitmap.height()); |
| 432 EXPECT_EQ(expected_bitmap.config(), bitmap.config()); | 432 EXPECT_EQ(expected_bitmap.colorType(), bitmap.colorType()); |
| 433 SkAutoLockPixels expected_bitmap_lock(expected_bitmap); | 433 SkAutoLockPixels expected_bitmap_lock(expected_bitmap); |
| 434 SkAutoLockPixels bitmap_lock(bitmap); | 434 SkAutoLockPixels bitmap_lock(bitmap); |
| 435 int fails = 0; | 435 int fails = 0; |
| 436 for (int i = 0; i < bitmap.width() && fails < 10; ++i) { | 436 for (int i = 0; i < bitmap.width() && fails < 10; ++i) { |
| 437 for (int j = 0; j < bitmap.height() && fails < 10; ++j) { | 437 for (int j = 0; j < bitmap.height() && fails < 10; ++j) { |
| 438 if (!exclude_rect_.IsEmpty() && exclude_rect_.Contains(i, j)) | 438 if (!exclude_rect_.IsEmpty() && exclude_rect_.Contains(i, j)) |
| 439 continue; | 439 continue; |
| 440 | 440 |
| 441 SkColor expected_color = expected_bitmap.getColor(i, j); | 441 SkColor expected_color = expected_bitmap.getColor(i, j); |
| 442 SkColor color = bitmap.getColor(i, j); | 442 SkColor color = bitmap.getColor(i, j); |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 CompositingRenderWidgetHostViewBrowserTestTabCapture, | 853 CompositingRenderWidgetHostViewBrowserTestTabCapture, |
| 854 testing::ValuesIn(kAllCompositingModes)); | 854 testing::ValuesIn(kAllCompositingModes)); |
| 855 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, | 855 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, |
| 856 CompositingRenderWidgetHostViewTabCaptureHighDPI, | 856 CompositingRenderWidgetHostViewTabCaptureHighDPI, |
| 857 testing::ValuesIn(kAllCompositingModes)); | 857 testing::ValuesIn(kAllCompositingModes)); |
| 858 | 858 |
| 859 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 859 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
| 860 | 860 |
| 861 } // namespace | 861 } // namespace |
| 862 } // namespace content | 862 } // namespace content |
| OLD | NEW |