| 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/surfaces/surface_factory_client.h" | 19 #include "cc/surfaces/surface_factory_client.h" |
| 19 #include "third_party/skia/include/core/SkRegion.h" | 20 #include "third_party/skia/include/core/SkRegion.h" |
| 20 #include "third_party/skia/include/core/SkXfermode.h" | 21 #include "third_party/skia/include/core/SkXfermode.h" |
| 21 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
| 22 #include "ui/aura/window_observer.h" | 23 #include "ui/aura/window_observer.h" |
| 23 #include "ui/compositor/compositor_observer.h" | 24 #include "ui/compositor/compositor_observer.h" |
| 24 #include "ui/compositor/layer_owner_delegate.h" | 25 #include "ui/compositor/layer_owner_delegate.h" |
| 25 #include "ui/gfx/geometry/rect.h" | 26 #include "ui/gfx/geometry/rect.h" |
| 26 | 27 |
| 27 namespace base { | 28 namespace base { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 base::WeakPtr<Buffer> pending_buffer_; | 251 base::WeakPtr<Buffer> pending_buffer_; |
| 251 | 252 |
| 252 cc::SurfaceManager* surface_manager_; | 253 cc::SurfaceManager* surface_manager_; |
| 253 | 254 |
| 254 scoped_refptr<SurfaceFactoryOwner> factory_owner_; | 255 scoped_refptr<SurfaceFactoryOwner> factory_owner_; |
| 255 | 256 |
| 256 // The Surface Id currently attached to the window. | 257 // The Surface Id currently attached to the window. |
| 257 cc::SurfaceId surface_id_; | 258 cc::SurfaceId surface_id_; |
| 258 | 259 |
| 259 // The next resource id the buffer will be attached to. | 260 // The next resource id the buffer will be attached to. |
| 260 int next_resource_id_ = 0; | 261 int next_resource_id_ = 1; |
| 261 | 262 |
| 262 // The damage region to schedule paint for when Commit() is called. | 263 // The damage region to schedule paint for when Commit() is called. |
| 263 SkRegion pending_damage_; | 264 SkRegion pending_damage_; |
| 264 | 265 |
| 265 // These lists contains the callbacks to notify the client when it is a good | 266 // These lists contains the callbacks to notify the client when it is a good |
| 266 // time to start producing a new frame. These callbacks move to | 267 // time to start producing a new frame. These callbacks move to |
| 267 // |frame_callbacks_| when Commit() is called. Later they are moved to | 268 // |frame_callbacks_| when Commit() is called. Later they are moved to |
| 268 // |active_frame_callbacks_| when the effect of the Commit() is reflected in | 269 // |active_frame_callbacks_| when the effect of the Commit() is reflected in |
| 269 // the compositor's active layer tree. The callbacks fire once we're notified | 270 // the compositor's active layer tree. The callbacks fire once we're notified |
| 270 // that the compositor started drawing that active layer tree. | 271 // that the compositor started drawing that active layer tree. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 309 |
| 309 // The alpha state to take effect when Commit() is called. | 310 // The alpha state to take effect when Commit() is called. |
| 310 float pending_alpha_; | 311 float pending_alpha_; |
| 311 | 312 |
| 312 // The active alpha state. | 313 // The active alpha state. |
| 313 float alpha_; | 314 float alpha_; |
| 314 | 315 |
| 315 // The buffer that is currently set as content of surface. | 316 // The buffer that is currently set as content of surface. |
| 316 base::WeakPtr<Buffer> current_buffer_; | 317 base::WeakPtr<Buffer> current_buffer_; |
| 317 | 318 |
| 319 // The last resource that was sent to a surface. |
| 320 cc::TransferableResource current_resource_; |
| 321 |
| 318 // The active input region used for hit testing. | 322 // The active input region used for hit testing. |
| 319 SkRegion input_region_; | 323 SkRegion input_region_; |
| 320 | 324 |
| 321 // This is true if a call to Commit() as been made but | 325 // This is true if a call to Commit() as been made but |
| 322 // CommitSurfaceHierarchy() has not yet been called. | 326 // CommitSurfaceHierarchy() has not yet been called. |
| 323 bool needs_commit_surface_hierarchy_; | 327 bool needs_commit_surface_hierarchy_; |
| 324 | 328 |
| 325 // This is set when the compositing starts and passed to active frame | 329 // This is set when the compositing starts and passed to active frame |
| 326 // callbacks when compositing successfully ends. | 330 // callbacks when compositing successfully ends. |
| 327 base::TimeTicks last_compositing_start_time_; | 331 base::TimeTicks last_compositing_start_time_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 346 | 350 |
| 347 // Surface observer list. Surface does not own the observers. | 351 // Surface observer list. Surface does not own the observers. |
| 348 base::ObserverList<SurfaceObserver, true> observers_; | 352 base::ObserverList<SurfaceObserver, true> observers_; |
| 349 | 353 |
| 350 DISALLOW_COPY_AND_ASSIGN(Surface); | 354 DISALLOW_COPY_AND_ASSIGN(Surface); |
| 351 }; | 355 }; |
| 352 | 356 |
| 353 } // namespace exo | 357 } // namespace exo |
| 354 | 358 |
| 355 #endif // COMPONENTS_EXO_SURFACE_H_ | 359 #endif // COMPONENTS_EXO_SURFACE_H_ |
| OLD | NEW |