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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
19 #include "cc/base/region.h" | 19 #include "cc/base/region.h" |
20 #include "cc/layers/content_layer_client.h" | 20 #include "cc/layers/content_layer_client.h" |
21 #include "cc/layers/layer_client.h" | 21 #include "cc/layers/layer_client.h" |
22 #include "cc/layers/surface_layer.h" | 22 #include "cc/layers/surface_layer.h" |
23 #include "cc/layers/texture_layer_client.h" | 23 #include "cc/layers/texture_layer_client.h" |
24 #include "cc/resources/texture_mailbox.h" | 24 #include "cc/resources/texture_mailbox.h" |
25 #include "cc/surfaces/surface_id.h" | 25 #include "cc/surfaces/sequence_surface_reference_factory.h" |
26 #include "third_party/skia/include/core/SkColor.h" | 26 #include "third_party/skia/include/core/SkColor.h" |
27 #include "third_party/skia/include/core/SkRegion.h" | 27 #include "third_party/skia/include/core/SkRegion.h" |
28 #include "ui/compositor/compositor.h" | 28 #include "ui/compositor/compositor.h" |
29 #include "ui/compositor/layer_animation_delegate.h" | 29 #include "ui/compositor/layer_animation_delegate.h" |
30 #include "ui/compositor/layer_delegate.h" | 30 #include "ui/compositor/layer_delegate.h" |
31 #include "ui/compositor/layer_type.h" | 31 #include "ui/compositor/layer_type.h" |
32 #include "ui/gfx/geometry/rect.h" | 32 #include "ui/gfx/geometry/rect.h" |
33 #include "ui/gfx/image/image_skia.h" | 33 #include "ui/gfx/image/image_skia.h" |
34 #include "ui/gfx/transform.h" | 34 #include "ui/gfx/transform.h" |
35 | 35 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // shared memory resource or an actual mailbox for a texture. | 286 // shared memory resource or an actual mailbox for a texture. |
287 void SetTextureMailbox( | 287 void SetTextureMailbox( |
288 const cc::TextureMailbox& mailbox, | 288 const cc::TextureMailbox& mailbox, |
289 std::unique_ptr<cc::SingleReleaseCallback> release_callback, | 289 std::unique_ptr<cc::SingleReleaseCallback> release_callback, |
290 gfx::Size texture_size_in_dip); | 290 gfx::Size texture_size_in_dip); |
291 void SetTextureSize(gfx::Size texture_size_in_dip); | 291 void SetTextureSize(gfx::Size texture_size_in_dip); |
292 void SetTextureFlipped(bool flipped); | 292 void SetTextureFlipped(bool flipped); |
293 bool TextureFlipped() const; | 293 bool TextureFlipped() const; |
294 | 294 |
295 // Begins showing content from a surface with a particular id. | 295 // Begins showing content from a surface with a particular id. |
296 void SetShowSurface(const cc::SurfaceId& surface_id, | 296 void SetShowSurface(const cc::SurfaceInfo& surface_info, |
297 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, | 297 scoped_refptr<cc::SurfaceReferenceFactory> surface_ref); |
298 const cc::SurfaceLayer::RequireCallback& require_callback, | |
299 const gfx::Size& surface_size_in_pixels, | |
300 float scale); | |
301 | 298 |
302 bool has_external_content() { | 299 bool has_external_content() { |
303 return texture_layer_.get() || surface_layer_.get(); | 300 return texture_layer_.get() || surface_layer_.get(); |
304 } | 301 } |
305 | 302 |
306 // Show a solid color instead of delegated or surface contents. | 303 // Show a solid color instead of delegated or surface contents. |
307 void SetShowSolidColorContent(); | 304 void SetShowSolidColorContent(); |
308 | 305 |
309 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. | 306 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. |
310 void SetColor(SkColor color); | 307 void SetColor(SkColor color); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 537 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
541 // or SetTextureMailbox was called. | 538 // or SetTextureMailbox was called. |
542 gfx::Size frame_size_in_dip_; | 539 gfx::Size frame_size_in_dip_; |
543 | 540 |
544 DISALLOW_COPY_AND_ASSIGN(Layer); | 541 DISALLOW_COPY_AND_ASSIGN(Layer); |
545 }; | 542 }; |
546 | 543 |
547 } // namespace ui | 544 } // namespace ui |
548 | 545 |
549 #endif // UI_COMPOSITOR_LAYER_H_ | 546 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |