Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: cc/output/gl_renderer_unittest.cc

Issue 2736643004: Add DCLayerOverlayProcessor and supporting DCLayer structures. (Closed)
Patch Set: split CALayerOverlay into DCLayerOverlay Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/overlay_candidate_validator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 std::vector<gfx::Rect>* content_bounds)); 1635 std::vector<gfx::Rect>* content_bounds));
1636 }; 1636 };
1637 1637
1638 class Validator : public OverlayCandidateValidator { 1638 class Validator : public OverlayCandidateValidator {
1639 public: 1639 public:
1640 void GetStrategies(OverlayProcessor::StrategyList* strategies) override {} 1640 void GetStrategies(OverlayProcessor::StrategyList* strategies) override {}
1641 1641
1642 // Returns true if draw quads can be represented as CALayers (Mac only). 1642 // Returns true if draw quads can be represented as CALayers (Mac only).
1643 MOCK_METHOD0(AllowCALayerOverlays, bool()); 1643 MOCK_METHOD0(AllowCALayerOverlays, bool());
1644 1644
1645 bool AllowDCLayerOverlays() override { return false; }
1646
1645 // A list of possible overlay candidates is presented to this function. 1647 // A list of possible overlay candidates is presented to this function.
1646 // The expected result is that those candidates that can be in a separate 1648 // The expected result is that those candidates that can be in a separate
1647 // plane are marked with |overlay_handled| set to true, otherwise they are 1649 // plane are marked with |overlay_handled| set to true, otherwise they are
1648 // to be traditionally composited. Candidates with |overlay_handled| set to 1650 // to be traditionally composited. Candidates with |overlay_handled| set to
1649 // true must also have their |display_rect| converted to integer 1651 // true must also have their |display_rect| converted to integer
1650 // coordinates if necessary. 1652 // coordinates if necessary.
1651 void CheckOverlaySupport(OverlayCandidateList* surfaces) {} 1653 void CheckOverlaySupport(OverlayCandidateList* surfaces) {}
1652 }; 1654 };
1653 1655
1654 explicit TestOverlayProcessor(OutputSurface* surface) 1656 explicit TestOverlayProcessor(OutputSurface* surface)
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 class SingleOverlayOnTopProcessor : public OverlayProcessor { 1778 class SingleOverlayOnTopProcessor : public OverlayProcessor {
1777 public: 1779 public:
1778 class SingleOverlayValidator : public OverlayCandidateValidator { 1780 class SingleOverlayValidator : public OverlayCandidateValidator {
1779 public: 1781 public:
1780 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { 1782 void GetStrategies(OverlayProcessor::StrategyList* strategies) override {
1781 strategies->push_back(base::MakeUnique<OverlayStrategySingleOnTop>(this)); 1783 strategies->push_back(base::MakeUnique<OverlayStrategySingleOnTop>(this));
1782 strategies->push_back(base::MakeUnique<OverlayStrategyUnderlay>(this)); 1784 strategies->push_back(base::MakeUnique<OverlayStrategyUnderlay>(this));
1783 } 1785 }
1784 1786
1785 bool AllowCALayerOverlays() override { return false; } 1787 bool AllowCALayerOverlays() override { return false; }
1788 bool AllowDCLayerOverlays() override { return false; }
1786 1789
1787 void CheckOverlaySupport(OverlayCandidateList* surfaces) override { 1790 void CheckOverlaySupport(OverlayCandidateList* surfaces) override {
1788 ASSERT_EQ(1U, surfaces->size()); 1791 ASSERT_EQ(1U, surfaces->size());
1789 OverlayCandidate& candidate = surfaces->back(); 1792 OverlayCandidate& candidate = surfaces->back();
1790 candidate.overlay_handled = true; 1793 candidate.overlay_handled = true;
1791 } 1794 }
1792 }; 1795 };
1793 1796
1794 explicit SingleOverlayOnTopProcessor(OutputSurface* surface) 1797 explicit SingleOverlayOnTopProcessor(OutputSurface* surface)
1795 : OverlayProcessor(surface) {} 1798 : OverlayProcessor(surface) {}
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 renderer_->SetVisible(true); 2055 renderer_->SetVisible(true);
2053 Mock::VerifyAndClearExpectations(context_support_ptr_); 2056 Mock::VerifyAndClearExpectations(context_support_ptr_);
2054 2057
2055 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); 2058 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true));
2056 renderer_->SetVisible(false); 2059 renderer_->SetVisible(false);
2057 Mock::VerifyAndClearExpectations(context_support_ptr_); 2060 Mock::VerifyAndClearExpectations(context_support_ptr_);
2058 } 2061 }
2059 2062
2060 } // namespace 2063 } // namespace
2061 } // namespace cc 2064 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/overlay_candidate_validator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698