OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ |
6 #define UI_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; | 379 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; |
380 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); | 380 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); |
381 const cc::RendererSettings& GetRendererSettings() const; | 381 const cc::RendererSettings& GetRendererSettings() const; |
382 | 382 |
383 LayerAnimatorCollection* layer_animator_collection() { | 383 LayerAnimatorCollection* layer_animator_collection() { |
384 return &layer_animator_collection_; | 384 return &layer_animator_collection_; |
385 } | 385 } |
386 | 386 |
387 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } | 387 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } |
388 int committed_frame_number() const { return committed_frame_number_; } | 388 int activated_frame_count() const { return activated_frame_count_; } |
389 float refresh_rate() const { return refresh_rate_; } | 389 float refresh_rate() const { return refresh_rate_; } |
390 | 390 |
391 private: | 391 private: |
392 friend class base::RefCounted<Compositor>; | 392 friend class base::RefCounted<Compositor>; |
393 friend class CompositorLock; | 393 friend class CompositorLock; |
394 | 394 |
395 // Called by CompositorLock. | 395 // Called by CompositorLock. |
396 void UnlockCompositor(); | 396 void UnlockCompositor(); |
397 | 397 |
398 // Called to release any pending CompositorLock | 398 // Called to release any pending CompositorLock |
399 void CancelCompositorLock(); | 399 void CancelCompositorLock(); |
400 | 400 |
401 gfx::Size size_; | 401 gfx::Size size_; |
402 | 402 |
403 ui::ContextFactory* context_factory_; | 403 ui::ContextFactory* context_factory_; |
404 ui::ContextFactoryPrivate* context_factory_private_; | 404 ui::ContextFactoryPrivate* context_factory_private_; |
405 | 405 |
406 // The root of the Layer tree drawn by this compositor. | 406 // The root of the Layer tree drawn by this compositor. |
407 Layer* root_layer_; | 407 Layer* root_layer_; |
408 | 408 |
409 base::ObserverList<CompositorObserver, true> observer_list_; | 409 base::ObserverList<CompositorObserver, true> observer_list_; |
410 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; | 410 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; |
411 | 411 |
412 gfx::AcceleratedWidget widget_; | 412 gfx::AcceleratedWidget widget_; |
413 // A sequence number of a current compositor frame for use with metrics. | 413 // A sequence number of a current compositor frame for use with metrics. |
414 int committed_frame_number_; | 414 int activated_frame_count_; |
415 | 415 |
416 // current VSYNC refresh rate per second. | 416 // current VSYNC refresh rate per second. |
417 float refresh_rate_; | 417 float refresh_rate_; |
418 | 418 |
419 // A map from child id to parent id. | 419 // A map from child id to parent id. |
420 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash> child_frame_sinks_; | 420 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash> child_frame_sinks_; |
421 bool widget_valid_; | 421 bool widget_valid_; |
422 bool compositor_frame_sink_requested_; | 422 bool compositor_frame_sink_requested_; |
423 const cc::FrameSinkId frame_sink_id_; | 423 const cc::FrameSinkId frame_sink_id_; |
424 scoped_refptr<cc::Layer> root_web_layer_; | 424 scoped_refptr<cc::Layer> root_web_layer_; |
(...skipping 19 matching lines...) Expand all Loading... |
444 gfx::ColorSpace blending_color_space_; | 444 gfx::ColorSpace blending_color_space_; |
445 | 445 |
446 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 446 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
447 | 447 |
448 DISALLOW_COPY_AND_ASSIGN(Compositor); | 448 DISALLOW_COPY_AND_ASSIGN(Compositor); |
449 }; | 449 }; |
450 | 450 |
451 } // namespace ui | 451 } // namespace ui |
452 | 452 |
453 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 453 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |