| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 static void ConvertPointToLayer(const Layer* source, | 264 static void ConvertPointToLayer(const Layer* source, |
| 265 const Layer* target, | 265 const Layer* target, |
| 266 gfx::Point* point); | 266 gfx::Point* point); |
| 267 | 267 |
| 268 // Converts a transform to be relative to the given |ancestor|. Returns | 268 // Converts a transform to be relative to the given |ancestor|. Returns |
| 269 // whether success (that is, whether the given ancestor was really an | 269 // whether success (that is, whether the given ancestor was really an |
| 270 // ancestor of this layer). | 270 // ancestor of this layer). |
| 271 bool GetTargetTransformRelativeTo(const Layer* ancestor, | 271 bool GetTargetTransformRelativeTo(const Layer* ancestor, |
| 272 gfx::Transform* transform) const; | 272 gfx::Transform* transform) const; |
| 273 | 273 |
| 274 // See description in View for details | 274 // Note: Setting a layer non-opaque has significant performance impact, |
| 275 // especially on low-end Chrome OS devices. Please ensure you are not |
| 276 // adding unnecessary overdraw. When in doubt, talk to the graphics team. |
| 275 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); | 277 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); |
| 276 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } | 278 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } |
| 277 | 279 |
| 278 // Set to true if this layer always paints completely within its bounds. If so | 280 // Set to true if this layer always paints completely within its bounds. If so |
| 279 // we can omit an unnecessary clear, even if the layer is transparent. | 281 // we can omit an unnecessary clear, even if the layer is transparent. |
| 280 void SetFillsBoundsCompletely(bool fills_bounds_completely); | 282 void SetFillsBoundsCompletely(bool fills_bounds_completely); |
| 281 | 283 |
| 282 const std::string& name() const { return name_; } | 284 const std::string& name() const { return name_; } |
| 283 void set_name(const std::string& name) { name_ = name; } | 285 void set_name(const std::string& name) { name_ = name; } |
| 284 | 286 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 462 |
| 461 // If true, changes to the bounds of this layer are propagated to mirrors. | 463 // If true, changes to the bounds of this layer are propagated to mirrors. |
| 462 bool sync_bounds_ = false; | 464 bool sync_bounds_ = false; |
| 463 | 465 |
| 464 gfx::Rect bounds_; | 466 gfx::Rect bounds_; |
| 465 gfx::Vector2dF subpixel_position_offset_; | 467 gfx::Vector2dF subpixel_position_offset_; |
| 466 | 468 |
| 467 // Visibility of this layer. See SetVisible/IsDrawn for more details. | 469 // Visibility of this layer. See SetVisible/IsDrawn for more details. |
| 468 bool visible_; | 470 bool visible_; |
| 469 | 471 |
| 472 // See SetFillsBoundsOpaquely(). Defaults to true. |
| 470 bool fills_bounds_opaquely_; | 473 bool fills_bounds_opaquely_; |
| 474 |
| 471 bool fills_bounds_completely_; | 475 bool fills_bounds_completely_; |
| 472 | 476 |
| 473 // Union of damaged rects, in layer space, that SetNeedsDisplayRect should | 477 // Union of damaged rects, in layer space, that SetNeedsDisplayRect should |
| 474 // be called on. | 478 // be called on. |
| 475 cc::Region damaged_region_; | 479 cc::Region damaged_region_; |
| 476 | 480 |
| 477 // Union of damaged rects, in layer space, to be used when compositor is ready | 481 // Union of damaged rects, in layer space, to be used when compositor is ready |
| 478 // to paint the content. | 482 // to paint the content. |
| 479 cc::Region paint_region_; | 483 cc::Region paint_region_; |
| 480 | 484 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 545 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
| 542 // or SetTextureMailbox was called. | 546 // or SetTextureMailbox was called. |
| 543 gfx::Size frame_size_in_dip_; | 547 gfx::Size frame_size_in_dip_; |
| 544 | 548 |
| 545 DISALLOW_COPY_AND_ASSIGN(Layer); | 549 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 546 }; | 550 }; |
| 547 | 551 |
| 548 } // namespace ui | 552 } // namespace ui |
| 549 | 553 |
| 550 #endif // UI_COMPOSITOR_LAYER_H_ | 554 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |