OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_EXO_SURFACE_H_ | 5 #ifndef COMPONENTS_EXO_SURFACE_H_ |
6 #define COMPONENTS_EXO_SURFACE_H_ | 6 #define COMPONENTS_EXO_SURFACE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // double-buffered and will be applied when Commit() is called. | 76 // double-buffered and will be applied when Commit() is called. |
77 void AddSubSurface(Surface* sub_surface); | 77 void AddSubSurface(Surface* sub_surface); |
78 void RemoveSubSurface(Surface* sub_surface); | 78 void RemoveSubSurface(Surface* sub_surface); |
79 void SetSubSurfacePosition(Surface* sub_surface, const gfx::Point& position); | 79 void SetSubSurfacePosition(Surface* sub_surface, const gfx::Point& position); |
80 void PlaceSubSurfaceAbove(Surface* sub_surface, Surface* reference); | 80 void PlaceSubSurfaceAbove(Surface* sub_surface, Surface* reference); |
81 void PlaceSubSurfaceBelow(Surface* sub_surface, Surface* sibling); | 81 void PlaceSubSurfaceBelow(Surface* sub_surface, Surface* sibling); |
82 | 82 |
83 // This sets the surface viewport for scaling. | 83 // This sets the surface viewport for scaling. |
84 void SetViewport(const gfx::Size& viewport); | 84 void SetViewport(const gfx::Size& viewport); |
85 | 85 |
| 86 // This sets the only visible on secure output flag, preventing it from |
| 87 // appearing in screenshots or from being viewed on non-secure displays. |
| 88 void SetOnlyVisibleOnSecureOutput(bool only_visible_on_secure_output); |
| 89 |
86 // Surface state (damage regions, attached buffers, etc.) is double-buffered. | 90 // Surface state (damage regions, attached buffers, etc.) is double-buffered. |
87 // A Commit() call atomically applies all pending state, replacing the | 91 // A Commit() call atomically applies all pending state, replacing the |
88 // current state. Commit() is not guaranteed to be synchronous. See | 92 // current state. Commit() is not guaranteed to be synchronous. See |
89 // CommitSurfaceHierarchy() below. | 93 // CommitSurfaceHierarchy() below. |
90 void Commit(); | 94 void Commit(); |
91 | 95 |
92 // This will synchronously commit all pending state of the surface and its | 96 // This will synchronously commit all pending state of the surface and its |
93 // descendants by recursively calling CommitSurfaceHierarchy() for each | 97 // descendants by recursively calling CommitSurfaceHierarchy() for each |
94 // sub-surface with pending state. | 98 // sub-surface with pending state. |
95 void CommitSurfaceHierarchy(); | 99 void CommitSurfaceHierarchy(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // The stack of sub-surfaces to take effect when Commit() is called. | 187 // The stack of sub-surfaces to take effect when Commit() is called. |
184 // Bottom-most sub-surface at the front of the list and top-most sub-surface | 188 // Bottom-most sub-surface at the front of the list and top-most sub-surface |
185 // at the back. | 189 // at the back. |
186 using SubSurfaceEntry = std::pair<Surface*, gfx::Point>; | 190 using SubSurfaceEntry = std::pair<Surface*, gfx::Point>; |
187 using SubSurfaceEntryList = std::list<SubSurfaceEntry>; | 191 using SubSurfaceEntryList = std::list<SubSurfaceEntry>; |
188 SubSurfaceEntryList pending_sub_surfaces_; | 192 SubSurfaceEntryList pending_sub_surfaces_; |
189 | 193 |
190 // The viewport to take effect when Commit() is called. | 194 // The viewport to take effect when Commit() is called. |
191 gfx::Size pending_viewport_; | 195 gfx::Size pending_viewport_; |
192 | 196 |
| 197 // The secure output visibility state to take effect when Commit() is called. |
| 198 bool pending_only_visible_on_secure_output_; |
| 199 |
193 // The buffer that is currently set as content of surface. | 200 // The buffer that is currently set as content of surface. |
194 base::WeakPtr<Buffer> current_buffer_; | 201 base::WeakPtr<Buffer> current_buffer_; |
195 | 202 |
196 // The active input region used for hit testing. | 203 // The active input region used for hit testing. |
197 SkRegion input_region_; | 204 SkRegion input_region_; |
198 | 205 |
199 // This is true if a call to Commit() as been made but | 206 // This is true if a call to Commit() as been made but |
200 // CommitSurfaceHierarchy() has not yet been called. | 207 // CommitSurfaceHierarchy() has not yet been called. |
201 bool needs_commit_surface_hierarchy_; | 208 bool needs_commit_surface_hierarchy_; |
202 | 209 |
(...skipping 15 matching lines...) Expand all Loading... |
218 | 225 |
219 // Surface observer list. Surface does not own the observers. | 226 // Surface observer list. Surface does not own the observers. |
220 base::ObserverList<SurfaceObserver, true> observers_; | 227 base::ObserverList<SurfaceObserver, true> observers_; |
221 | 228 |
222 DISALLOW_COPY_AND_ASSIGN(Surface); | 229 DISALLOW_COPY_AND_ASSIGN(Surface); |
223 }; | 230 }; |
224 | 231 |
225 } // namespace exo | 232 } // namespace exo |
226 | 233 |
227 #endif // COMPONENTS_EXO_SURFACE_H_ | 234 #endif // COMPONENTS_EXO_SURFACE_H_ |
OLD | NEW |