| 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_LAYER_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_H_ |
| 6 #define UI_COMPOSITOR_LAYER_H_ | 6 #define UI_COMPOSITOR_LAYER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "cc/animation/animation_events.h" | 15 #include "cc/animation/animation_events.h" |
| 16 #include "cc/animation/layer_animation_event_observer.h" | 16 #include "cc/animation/layer_animation_event_observer.h" |
| 17 #include "cc/base/scoped_ptr_vector.h" | 17 #include "cc/base/scoped_ptr_vector.h" |
| 18 #include "cc/layers/content_layer_client.h" | 18 #include "cc/layers/content_layer_client.h" |
| 19 #include "cc/layers/layer_client.h" | 19 #include "cc/layers/layer_client.h" |
| 20 #include "cc/layers/surface_layer.h" |
| 20 #include "cc/layers/texture_layer_client.h" | 21 #include "cc/layers/texture_layer_client.h" |
| 21 #include "cc/resources/texture_mailbox.h" | 22 #include "cc/resources/texture_mailbox.h" |
| 22 #include "cc/surfaces/surface_id.h" | 23 #include "cc/surfaces/surface_id.h" |
| 23 #include "third_party/skia/include/core/SkColor.h" | 24 #include "third_party/skia/include/core/SkColor.h" |
| 24 #include "third_party/skia/include/core/SkRegion.h" | 25 #include "third_party/skia/include/core/SkRegion.h" |
| 25 #include "ui/compositor/compositor.h" | 26 #include "ui/compositor/compositor.h" |
| 26 #include "ui/compositor/layer_animation_delegate.h" | 27 #include "ui/compositor/layer_animation_delegate.h" |
| 27 #include "ui/compositor/layer_delegate.h" | 28 #include "ui/compositor/layer_delegate.h" |
| 28 #include "ui/compositor/layer_type.h" | 29 #include "ui/compositor/layer_type.h" |
| 29 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 void SetTextureMailbox(const cc::TextureMailbox& mailbox, | 273 void SetTextureMailbox(const cc::TextureMailbox& mailbox, |
| 273 scoped_ptr<cc::SingleReleaseCallback> release_callback, | 274 scoped_ptr<cc::SingleReleaseCallback> release_callback, |
| 274 gfx::Size texture_size_in_dip); | 275 gfx::Size texture_size_in_dip); |
| 275 void SetTextureSize(gfx::Size texture_size_in_dip); | 276 void SetTextureSize(gfx::Size texture_size_in_dip); |
| 276 | 277 |
| 277 // Begins showing delegated frames from the |frame_provider|. | 278 // Begins showing delegated frames from the |frame_provider|. |
| 278 void SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, | 279 void SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, |
| 279 gfx::Size frame_size_in_dip); | 280 gfx::Size frame_size_in_dip); |
| 280 | 281 |
| 281 // Begins showing content from a surface with a particular id. | 282 // Begins showing content from a surface with a particular id. |
| 282 void SetShowSurface(cc::SurfaceId id, gfx::Size frame_size_in_dip); | 283 void SetShowSurface(cc::SurfaceId surface_id, |
| 284 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
| 285 const cc::SurfaceLayer::RequireCallback& require_callback, |
| 286 gfx::Size frame_size_in_dip); |
| 283 | 287 |
| 284 bool has_external_content() { | 288 bool has_external_content() { |
| 285 return texture_layer_.get() || delegated_renderer_layer_.get() || | 289 return texture_layer_.get() || delegated_renderer_layer_.get() || |
| 286 surface_layer_.get(); | 290 surface_layer_.get(); |
| 287 } | 291 } |
| 288 | 292 |
| 289 // Show a solid color instead of delegated or surface contents. | 293 // Show a solid color instead of delegated or surface contents. |
| 290 void SetShowSolidColorContent(); | 294 void SetShowSolidColorContent(); |
| 291 | 295 |
| 292 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. | 296 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 515 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
| 512 // or SetTextureMailbox was called. | 516 // or SetTextureMailbox was called. |
| 513 gfx::Size frame_size_in_dip_; | 517 gfx::Size frame_size_in_dip_; |
| 514 | 518 |
| 515 DISALLOW_COPY_AND_ASSIGN(Layer); | 519 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 516 }; | 520 }; |
| 517 | 521 |
| 518 } // namespace ui | 522 } // namespace ui |
| 519 | 523 |
| 520 #endif // UI_COMPOSITOR_LAYER_H_ | 524 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |