OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_DC_LAYER_OVERLAY_H_ | 5 #ifndef CC_OUTPUT_DC_LAYER_OVERLAY_H_ |
6 #define CC_OUTPUT_DC_LAYER_OVERLAY_H_ | 6 #define CC_OUTPUT_DC_LAYER_OVERLAY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/quads/render_pass.h" | 9 #include "cc/quads/render_pass.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 unsigned filter; | 59 unsigned filter; |
60 // If |rpdq| is present, then the renderer must draw the filter effects and | 60 // If |rpdq| is present, then the renderer must draw the filter effects and |
61 // copy the result into an IOSurface. | 61 // copy the result into an IOSurface. |
62 const RenderPassDrawQuad* rpdq = nullptr; | 62 const RenderPassDrawQuad* rpdq = nullptr; |
63 }; | 63 }; |
64 | 64 |
65 typedef std::vector<DCLayerOverlay> DCLayerOverlayList; | 65 typedef std::vector<DCLayerOverlay> DCLayerOverlayList; |
66 | 66 |
67 class DCLayerOverlayProcessor { | 67 class DCLayerOverlayProcessor { |
68 public: | 68 public: |
| 69 // This is used for a histogram to determine why overlays are or aren't |
| 70 // used, so don't remove entries and make sure to update enums.xml if |
| 71 // it changes. |
69 enum DCLayerResult { | 72 enum DCLayerResult { |
70 DC_LAYER_SUCCESS, | 73 DC_LAYER_SUCCESS, |
| 74 DC_LAYER_FAILED_UNSUPPORTED_QUAD, |
71 DC_LAYER_FAILED_QUAD_BLEND_MODE, | 75 DC_LAYER_FAILED_QUAD_BLEND_MODE, |
72 DC_LAYER_FAILED_TEXTURE_NOT_CANDIDATE, | 76 DC_LAYER_FAILED_TEXTURE_NOT_CANDIDATE, |
73 DC_LAYER_FAILED_OCCLUDED, | 77 DC_LAYER_FAILED_OCCLUDED, |
74 DC_LAYER_FAILED_UNKNOWN | 78 DC_LAYER_FAILED_COMPLEX_TRANSFORM, |
| 79 DC_LAYER_FAILED_MAX, |
75 }; | 80 }; |
76 | 81 |
77 void Process(ResourceProvider* resource_provider, | 82 void Process(ResourceProvider* resource_provider, |
78 const gfx::RectF& display_rect, | 83 const gfx::RectF& display_rect, |
79 QuadList* quad_list, | 84 QuadList* quad_list, |
80 gfx::Rect* overlay_damage_rect, | 85 gfx::Rect* overlay_damage_rect, |
81 gfx::Rect* damage_rect, | 86 gfx::Rect* damage_rect, |
82 DCLayerOverlayList* ca_layer_overlays); | 87 DCLayerOverlayList* ca_layer_overlays); |
83 void ClearOverlayState() { | 88 void ClearOverlayState() { |
84 previous_frame_underlay_rect_ = gfx::Rect(); | 89 previous_frame_underlay_rect_ = gfx::Rect(); |
85 previous_occlusion_bounding_box_ = gfx::Rect(); | 90 previous_occlusion_bounding_box_ = gfx::Rect(); |
86 } | 91 } |
87 | 92 |
88 private: | 93 private: |
89 DCLayerResult FromDrawQuad(ResourceProvider* resource_provider, | 94 DCLayerResult FromDrawQuad(ResourceProvider* resource_provider, |
90 const gfx::RectF& display_rect, | 95 const gfx::RectF& display_rect, |
91 QuadList::ConstIterator quad_list_begin, | 96 QuadList::ConstIterator quad_list_begin, |
92 QuadList::ConstIterator quad, | 97 QuadList::ConstIterator quad, |
93 DCLayerOverlay* ca_layer_overlay); | 98 DCLayerOverlay* ca_layer_overlay); |
94 | 99 |
95 gfx::Rect previous_frame_underlay_rect_; | 100 gfx::Rect previous_frame_underlay_rect_; |
96 gfx::Rect previous_occlusion_bounding_box_; | 101 gfx::Rect previous_occlusion_bounding_box_; |
97 gfx::RectF previous_display_rect_; | 102 gfx::RectF previous_display_rect_; |
98 }; | 103 }; |
99 | 104 |
100 } // namespace cc | 105 } // namespace cc |
101 | 106 |
102 #endif // CC_OUTPUT_DC_LAYER_OVERLAY_H_ | 107 #endif // CC_OUTPUT_DC_LAYER_OVERLAY_H_ |
OLD | NEW |