| 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> |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // Set new TextureMailbox for this layer. Note that |mailbox| may hold a | 274 // Set new TextureMailbox for this layer. Note that |mailbox| may hold a |
| 275 // shared memory resource or an actual mailbox for a texture. | 275 // shared memory resource or an actual mailbox for a texture. |
| 276 void SetTextureMailbox( | 276 void SetTextureMailbox( |
| 277 const cc::TextureMailbox& mailbox, | 277 const cc::TextureMailbox& mailbox, |
| 278 std::unique_ptr<cc::SingleReleaseCallback> release_callback, | 278 std::unique_ptr<cc::SingleReleaseCallback> release_callback, |
| 279 gfx::Size texture_size_in_dip); | 279 gfx::Size texture_size_in_dip); |
| 280 void SetTextureSize(gfx::Size texture_size_in_dip); | 280 void SetTextureSize(gfx::Size texture_size_in_dip); |
| 281 void SetTextureFlipped(bool flipped); | 281 void SetTextureFlipped(bool flipped); |
| 282 bool TextureFlipped() const; | 282 bool TextureFlipped() const; |
| 283 | 283 |
| 284 // The alpha value applied to the whole texture. The effective value of each | |
| 285 // pixel is computed as: | |
| 286 // pixel.a = pixel.a * alpha. | |
| 287 // Note: This is different from SetOpacity() as it only applies to the | |
| 288 // texture and child layers are unaffected. | |
| 289 // TODO(reveman): Remove once components/exo code is using SetShowSurface. | |
| 290 // crbug.com/610086 | |
| 291 void SetTextureAlpha(float alpha); | |
| 292 | |
| 293 // The texture crop rectangle to be used. Empty rectangle means no cropping. | |
| 294 void SetTextureCrop(const gfx::RectF& crop); | |
| 295 | |
| 296 // The texture scale to be used. Defaults to no scaling. | |
| 297 void SetTextureScale(float x_scale, float y_scale); | |
| 298 | |
| 299 // Begins showing content from a surface with a particular id. | 284 // Begins showing content from a surface with a particular id. |
| 300 void SetShowSurface(const cc::SurfaceId& surface_id, | 285 void SetShowSurface(const cc::SurfaceId& surface_id, |
| 301 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, | 286 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
| 302 const cc::SurfaceLayer::RequireCallback& require_callback, | 287 const cc::SurfaceLayer::RequireCallback& require_callback, |
| 303 gfx::Size surface_size, | 288 gfx::Size surface_size, |
| 304 float scale, | 289 float scale, |
| 305 gfx::Size frame_size_in_dip); | 290 gfx::Size frame_size_in_dip); |
| 306 | 291 |
| 307 bool has_external_content() { | 292 bool has_external_content() { |
| 308 return texture_layer_.get() || surface_layer_.get(); | 293 return texture_layer_.get() || surface_layer_.get(); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 cc::TextureMailbox mailbox_; | 512 cc::TextureMailbox mailbox_; |
| 528 | 513 |
| 529 // The callback to release the mailbox. This is only set after | 514 // The callback to release the mailbox. This is only set after |
| 530 // SetTextureMailbox is called, before we give it to the TextureLayer. | 515 // SetTextureMailbox is called, before we give it to the TextureLayer. |
| 531 std::unique_ptr<cc::SingleReleaseCallback> mailbox_release_callback_; | 516 std::unique_ptr<cc::SingleReleaseCallback> mailbox_release_callback_; |
| 532 | 517 |
| 533 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 518 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
| 534 // or SetTextureMailbox was called. | 519 // or SetTextureMailbox was called. |
| 535 gfx::Size frame_size_in_dip_; | 520 gfx::Size frame_size_in_dip_; |
| 536 | 521 |
| 537 // The texture crop rectangle. | |
| 538 gfx::RectF texture_crop_; | |
| 539 | |
| 540 // The texture scale. | |
| 541 float texture_x_scale_; | |
| 542 float texture_y_scale_; | |
| 543 | |
| 544 DISALLOW_COPY_AND_ASSIGN(Layer); | 522 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 545 }; | 523 }; |
| 546 | 524 |
| 547 } // namespace ui | 525 } // namespace ui |
| 548 | 526 |
| 549 #endif // UI_COMPOSITOR_LAYER_H_ | 527 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |