OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
6 | 6 |
7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
| 9 #include "cc/resources/sync_point_helper.h" |
9 #include "cc/test/pixel_test.h" | 10 #include "cc/test/pixel_test.h" |
10 #include "third_party/skia/include/core/SkImageFilter.h" | 11 #include "third_party/skia/include/core/SkImageFilter.h" |
11 #include "third_party/skia/include/core/SkMatrix.h" | 12 #include "third_party/skia/include/core/SkMatrix.h" |
12 #include "third_party/skia/include/effects/SkColorFilterImageFilter.h" | 13 #include "third_party/skia/include/effects/SkColorFilterImageFilter.h" |
13 #include "third_party/skia/include/effects/SkColorMatrixFilter.h" | 14 #include "third_party/skia/include/effects/SkColorMatrixFilter.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 namespace { | 17 namespace { |
17 | 18 |
18 class GLRendererPixelTest : public PixelTest {}; | 19 class GLRendererPixelTest : public PixelTest {}; |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 518 |
518 RenderPassList pass_list; | 519 RenderPassList pass_list; |
519 pass_list.push_back(pass.Pass()); | 520 pass_list.push_back(pass.Pass()); |
520 | 521 |
521 renderer_->DrawFrame(&pass_list); | 522 renderer_->DrawFrame(&pass_list); |
522 | 523 |
523 EXPECT_TRUE(PixelsMatchReference( | 524 EXPECT_TRUE(PixelsMatchReference( |
524 base::FilePath(FILE_PATH_LITERAL("anti_aliasing.png")), | 525 base::FilePath(FILE_PATH_LITERAL("anti_aliasing.png")), |
525 ExactPixelComparator(true))); | 526 ExactPixelComparator(true))); |
526 } | 527 } |
| 528 |
| 529 static void SyncPointCallback(int* callback_count) { |
| 530 ++(*callback_count); |
| 531 } |
| 532 |
| 533 TEST_F(GLRendererPixelTest, SignalSyncPoint) { |
| 534 int callback_count = 0; |
| 535 scoped_ptr<SyncPointHelper> helper = SyncPointHelper::SignalSyncPoint( |
| 536 output_surface_->context3d(), |
| 537 output_surface_->context3d()->insertSyncPoint(), |
| 538 base::Bind(&SyncPointCallback, &callback_count)); |
| 539 output_surface_->context3d()->finish(); |
| 540 EXPECT_EQ(1, callback_count); |
| 541 } |
527 #endif | 542 #endif |
528 | 543 |
529 } // namespace | 544 } // namespace |
530 } // namespace cc | 545 } // namespace cc |
OLD | NEW |