| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/base/region.h" | 5 #include "cc/base/region.h" |
| 6 #include "cc/base/scoped_ptr_vector.h" | 6 #include "cc/base/scoped_ptr_vector.h" |
| 7 #include "cc/output/compositor_frame_metadata.h" | 7 #include "cc/output/compositor_frame_metadata.h" |
| 8 #include "cc/output/gl_renderer.h" | 8 #include "cc/output/gl_renderer.h" |
| 9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
| 10 #include "cc/output/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 gfx::Transform(0, 1, 1, 0, 0, 0); // x,y -> y,x. | 54 gfx::Transform(0, 1, 1, 0, 0, 0); // x,y -> y,x. |
| 55 | 55 |
| 56 void MailboxReleased(unsigned sync_point, | 56 void MailboxReleased(unsigned sync_point, |
| 57 bool lost_resource, | 57 bool lost_resource, |
| 58 BlockingTaskRunner* main_thread_task_runner) { | 58 BlockingTaskRunner* main_thread_task_runner) { |
| 59 } | 59 } |
| 60 | 60 |
| 61 class SingleOverlayValidator : public OverlayCandidateValidator { | 61 class SingleOverlayValidator : public OverlayCandidateValidator { |
| 62 public: | 62 public: |
| 63 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { | 63 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { |
| 64 strategies->push_back(make_scoped_ptr( | 64 strategies->push_back( |
| 65 new OverlayStrategyCommon(this, new OverlayStrategySingleOnTop))); | 65 make_scoped_ptr(new OverlayStrategySingleOnTop(this))); |
| 66 strategies->push_back(make_scoped_ptr( | 66 strategies->push_back(make_scoped_ptr(new OverlayStrategyUnderlay(this))); |
| 67 new OverlayStrategyCommon(this, new OverlayStrategyUnderlay))); | |
| 68 } | 67 } |
| 69 void CheckOverlaySupport(OverlayCandidateList* surfaces) override { | 68 void CheckOverlaySupport(OverlayCandidateList* surfaces) override { |
| 70 // We may have 1 or 2 surfaces depending on whether this ran through the | 69 // We may have 1 or 2 surfaces depending on whether this ran through the |
| 71 // full renderer and picked up the output surface, or not. | 70 // full renderer and picked up the output surface, or not. |
| 72 ASSERT_LE(1U, surfaces->size()); | 71 ASSERT_LE(1U, surfaces->size()); |
| 73 ASSERT_GE(2U, surfaces->size()); | 72 ASSERT_GE(2U, surfaces->size()); |
| 74 | 73 |
| 75 OverlayCandidate& candidate = surfaces->back(); | 74 OverlayCandidate& candidate = surfaces->back(); |
| 76 EXPECT_TRUE(!candidate.use_output_surface_for_resource); | 75 EXPECT_TRUE(!candidate.use_output_surface_for_resource); |
| 77 if (candidate.display_rect.width() == 64) { | 76 if (candidate.display_rect.width() == 64) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 89 EXPECT_EQ(true, candidate.is_clipped); | 88 EXPECT_EQ(true, candidate.is_clipped); |
| 90 EXPECT_EQ(kOverlayClipRect, candidate.clip_rect); | 89 EXPECT_EQ(kOverlayClipRect, candidate.clip_rect); |
| 91 } | 90 } |
| 92 candidate.overlay_handled = true; | 91 candidate.overlay_handled = true; |
| 93 } | 92 } |
| 94 }; | 93 }; |
| 95 | 94 |
| 96 class SingleOnTopOverlayValidator : public SingleOverlayValidator { | 95 class SingleOnTopOverlayValidator : public SingleOverlayValidator { |
| 97 public: | 96 public: |
| 98 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { | 97 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { |
| 99 strategies->push_back(make_scoped_ptr( | 98 strategies->push_back( |
| 100 new OverlayStrategyCommon(this, new OverlayStrategySingleOnTop))); | 99 make_scoped_ptr(new OverlayStrategySingleOnTop(this))); |
| 101 } | 100 } |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 class UnderlayOverlayValidator : public SingleOverlayValidator { | 103 class UnderlayOverlayValidator : public SingleOverlayValidator { |
| 105 public: | 104 public: |
| 106 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { | 105 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { |
| 107 strategies->push_back(make_scoped_ptr( | 106 strategies->push_back(make_scoped_ptr(new OverlayStrategyUnderlay(this))); |
| 108 new OverlayStrategyCommon(this, new OverlayStrategyUnderlay))); | |
| 109 } | 107 } |
| 110 }; | 108 }; |
| 111 | 109 |
| 112 class SandwichOverlayValidator : public OverlayCandidateValidator { | 110 class SandwichOverlayValidator : public OverlayCandidateValidator { |
| 113 public: | 111 public: |
| 114 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { | 112 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { |
| 115 strategies->push_back(make_scoped_ptr( | 113 strategies->push_back(make_scoped_ptr(new OverlayStrategySandwich(this))); |
| 116 new OverlayStrategyCommon(this, new OverlayStrategySandwich))); | |
| 117 } | 114 } |
| 118 void CheckOverlaySupport(OverlayCandidateList* surfaces) override { | 115 void CheckOverlaySupport(OverlayCandidateList* surfaces) override { |
| 119 for (OverlayCandidate& candidate : *surfaces) | 116 for (OverlayCandidate& candidate : *surfaces) |
| 120 candidate.overlay_handled = true; | 117 candidate.overlay_handled = true; |
| 121 } | 118 } |
| 122 }; | 119 }; |
| 123 | 120 |
| 124 class AllOrNothingOverlayValidator : public OverlayCandidateValidator { | 121 class AllOrNothingOverlayValidator : public OverlayCandidateValidator { |
| 125 public: | 122 public: |
| 126 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { | 123 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 renderer_->BeginDrawingFrame(&frame_no_overlays); | 1654 renderer_->BeginDrawingFrame(&frame_no_overlays); |
| 1658 renderer_->FinishDrawingFrame(&frame_no_overlays); | 1655 renderer_->FinishDrawingFrame(&frame_no_overlays); |
| 1659 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1)); | 1656 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1)); |
| 1660 SwapBuffers(); | 1657 SwapBuffers(); |
| 1661 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); | 1658 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); |
| 1662 Mock::VerifyAndClearExpectations(&scheduler_); | 1659 Mock::VerifyAndClearExpectations(&scheduler_); |
| 1663 } | 1660 } |
| 1664 | 1661 |
| 1665 } // namespace | 1662 } // namespace |
| 1666 } // namespace cc | 1663 } // namespace cc |
| OLD | NEW |