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 <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "cc/resources/transferable_resource.h" | 18 #include "cc/resources/transferable_resource.h" |
19 #include "cc/scheduler/begin_frame_source.h" | 19 #include "cc/scheduler/begin_frame_source.h" |
20 #include "cc/surfaces/surface_factory_client.h" | 20 #include "cc/surfaces/surface_factory_client.h" |
| 21 #include "third_party/skia/include/core/SkBlendMode.h" |
21 #include "third_party/skia/include/core/SkRegion.h" | 22 #include "third_party/skia/include/core/SkRegion.h" |
22 #include "third_party/skia/include/core/SkXfermode.h" | |
23 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
24 #include "ui/aura/window_observer.h" | 24 #include "ui/aura/window_observer.h" |
25 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 namespace trace_event { | 28 namespace trace_event { |
29 class TracedValue; | 29 class TracedValue; |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 void SetViewport(const gfx::Size& viewport); | 146 void SetViewport(const gfx::Size& viewport); |
147 | 147 |
148 // This sets the surface crop rectangle. | 148 // This sets the surface crop rectangle. |
149 void SetCrop(const gfx::RectF& crop); | 149 void SetCrop(const gfx::RectF& crop); |
150 | 150 |
151 // This sets the only visible on secure output flag, preventing it from | 151 // This sets the only visible on secure output flag, preventing it from |
152 // appearing in screenshots or from being viewed on non-secure displays. | 152 // appearing in screenshots or from being viewed on non-secure displays. |
153 void SetOnlyVisibleOnSecureOutput(bool only_visible_on_secure_output); | 153 void SetOnlyVisibleOnSecureOutput(bool only_visible_on_secure_output); |
154 | 154 |
155 // This sets the blend mode that will be used when drawing the surface. | 155 // This sets the blend mode that will be used when drawing the surface. |
156 void SetBlendMode(SkXfermode::Mode blend_mode); | 156 void SetBlendMode(SkBlendMode blend_mode); |
157 | 157 |
158 // This sets the alpha value that will be applied to the whole surface. | 158 // This sets the alpha value that will be applied to the whole surface. |
159 void SetAlpha(float alpha); | 159 void SetAlpha(float alpha); |
160 | 160 |
161 // Surface state (damage regions, attached buffers, etc.) is double-buffered. | 161 // Surface state (damage regions, attached buffers, etc.) is double-buffered. |
162 // A Commit() call atomically applies all pending state, replacing the | 162 // A Commit() call atomically applies all pending state, replacing the |
163 // current state. Commit() is not guaranteed to be synchronous. See | 163 // current state. Commit() is not guaranteed to be synchronous. See |
164 // CommitSurfaceHierarchy() below. | 164 // CommitSurfaceHierarchy() below. |
165 void Commit(); | 165 void Commit(); |
166 | 166 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 bool operator==(const State& other); | 262 bool operator==(const State& other); |
263 bool operator!=(const State& other) { return !(*this == other); } | 263 bool operator!=(const State& other) { return !(*this == other); } |
264 | 264 |
265 SkRegion opaque_region; | 265 SkRegion opaque_region; |
266 SkRegion input_region; | 266 SkRegion input_region; |
267 float buffer_scale = 1.0f; | 267 float buffer_scale = 1.0f; |
268 gfx::Size viewport; | 268 gfx::Size viewport; |
269 gfx::RectF crop; | 269 gfx::RectF crop; |
270 bool only_visible_on_secure_output = false; | 270 bool only_visible_on_secure_output = false; |
271 SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode; | 271 SkBlendMode blend_mode = SkBlendMode::kSrcOver; |
272 float alpha = 1.0f; | 272 float alpha = 1.0f; |
273 }; | 273 }; |
274 class BufferAttachment { | 274 class BufferAttachment { |
275 public: | 275 public: |
276 BufferAttachment(); | 276 BufferAttachment(); |
277 ~BufferAttachment(); | 277 ~BufferAttachment(); |
278 | 278 |
279 BufferAttachment& operator=(BufferAttachment&& buffer); | 279 BufferAttachment& operator=(BufferAttachment&& buffer); |
280 | 280 |
281 base::WeakPtr<Buffer>& buffer(); | 281 base::WeakPtr<Buffer>& buffer(); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 // Surface observer list. Surface does not own the observers. | 423 // Surface observer list. Surface does not own the observers. |
424 base::ObserverList<SurfaceObserver, true> observers_; | 424 base::ObserverList<SurfaceObserver, true> observers_; |
425 | 425 |
426 DISALLOW_COPY_AND_ASSIGN(Surface); | 426 DISALLOW_COPY_AND_ASSIGN(Surface); |
427 }; | 427 }; |
428 | 428 |
429 } // namespace exo | 429 } // namespace exo |
430 | 430 |
431 #endif // COMPONENTS_EXO_SURFACE_H_ | 431 #endif // COMPONENTS_EXO_SURFACE_H_ |
OLD | NEW |