Chromium Code Reviews| 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 #ifndef CC_OUTPUT_OVERLAY_CANDIDATE_VALIDATOR_H_ | 5 #ifndef CC_OUTPUT_OVERLAY_CANDIDATE_VALIDATOR_H_ |
| 6 #define CC_OUTPUT_OVERLAY_CANDIDATE_VALIDATOR_H_ | 6 #define CC_OUTPUT_OVERLAY_CANDIDATE_VALIDATOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 11 #include "cc/base/resource_id.h" | |
| 11 #include "cc/output/overlay_candidate.h" | 12 #include "cc/output/overlay_candidate.h" |
| 12 #include "cc/output/overlay_processor.h" | 13 #include "cc/output/overlay_processor.h" |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 // This class that can be used to answer questions about possible overlay | 17 // This class that can be used to answer questions about possible overlay |
| 17 // configurations for a particular output device. | 18 // configurations for a particular output device. |
| 18 class CC_EXPORT OverlayCandidateValidator { | 19 class CC_EXPORT OverlayCandidateValidator { |
| 19 public: | 20 public: |
| 20 // Populates a list of strategies that may work with this validator. | 21 // Populates a list of strategies that may work with this validator. |
| 21 virtual void GetStrategies(OverlayProcessor::StrategyList* strategies) = 0; | 22 virtual void GetStrategies(OverlayProcessor::StrategyList* strategies) = 0; |
| 22 | 23 |
| 23 // Returns true if draw quads can be represented as CALayers (Mac only). | 24 // Returns true if draw quads can be represented as CALayers (Mac only). |
| 24 virtual bool AllowCALayerOverlays() = 0; | 25 virtual bool AllowCALayerOverlays() = 0; |
| 25 | 26 |
| 26 // A list of possible overlay candidates is presented to this function. | 27 // A list of possible overlay candidates is presented to this function. |
| 27 // The expected result is that those candidates that can be in a separate | 28 // The expected result is that those candidates that can be in a separate |
| 28 // plane are marked with |overlay_handled| set to true, otherwise they are | 29 // plane are marked with |overlay_handled| set to true, otherwise they are |
| 29 // to be traditionally composited. Candidates with |overlay_handled| set to | 30 // to be traditionally composited. Candidates with |overlay_handled| set to |
| 30 // true must also have their |display_rect| converted to integer | 31 // true must also have their |display_rect| converted to integer |
| 31 // coordinates if necessary. | 32 // coordinates if necessary. |
| 32 virtual void CheckOverlaySupport(OverlayCandidateList* surfaces) = 0; | 33 virtual void CheckOverlaySupport(OverlayCandidateList* surfaces) = 0; |
| 33 | 34 |
| 35 // Called before beginning a new pass for overlay promotion to clear out any | |
| 36 // promotable resources. One must CheckoverlaySupport() again. | |
| 37 virtual void ClearPromotableResources() {} | |
| 38 | |
| 39 // Returns whether |resource_id| is promotable. | |
| 40 virtual bool IsResourcePromotable(ResourceId resource_id); | |
|
piman
2016/11/23 00:37:25
Super nit: in the context of OverlayCandidateValid
liberato (no reviews please)
2016/12/01 20:59:11
i've since moved the set into OverlayCandidateList
| |
| 41 | |
| 34 virtual ~OverlayCandidateValidator() {} | 42 virtual ~OverlayCandidateValidator() {} |
| 35 }; | 43 }; |
| 36 | 44 |
| 37 } // namespace cc | 45 } // namespace cc |
| 38 | 46 |
| 39 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_VALIDATOR_H_ | 47 #endif // CC_OUTPUT_OVERLAY_CANDIDATE_VALIDATOR_H_ |
| OLD | NEW |