draw_properties.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef CC_LAYERS_DRAW_PROPERTIES_H_
  5. #define CC_LAYERS_DRAW_PROPERTIES_H_
  6. #include <stddef.h>
  7. #include "cc/trees/occlusion.h"
  8. #include "ui/gfx/geometry/mask_filter_info.h"
  9. #include "ui/gfx/geometry/rect.h"
  10. #include "ui/gfx/geometry/transform.h"
  11. namespace cc {
  12. // Container for properties that layers need to compute before they can be
  13. // drawn.
  14. struct CC_EXPORT DrawProperties {
  15. DrawProperties();
  16. ~DrawProperties();
  17. // Transforms objects from content space to target surface space, where
  18. // this layer would be drawn.
  19. gfx::Transform target_space_transform;
  20. // Transforms objects from content space to screen space (viewport space).
  21. gfx::Transform screen_space_transform;
  22. // Known occlusion above the layer mapped to the content space of the layer.
  23. Occlusion occlusion_in_content_space;
  24. // DrawProperties::opacity may be different than LayerImpl::opacity,
  25. // particularly in the case when a RenderSurface re-parents the layer's
  26. // opacity, or when opacity is compounded by the hierarchy.
  27. float opacity = 0.f;
  28. // Whether the layer has a potentially animating transform in its chain of
  29. // transforms to the screen. This is essentially a cache of the transform
  30. // node's potentially-animated status.
  31. bool screen_space_transform_is_animating = false;
  32. // True if the layer needs to be clipped by clip_rect.
  33. bool is_clipped = false;
  34. // If set, it makes the layer's rounded corner not trigger a render surface if
  35. // possible.
  36. bool is_fast_rounded_corner = false;
  37. // This rect is a bounding box around what part of the layer is visible, in
  38. // the layer's coordinate space.
  39. gfx::Rect visible_layer_rect;
  40. // In target surface space, the rect that encloses the clipped, visible,
  41. // and drawable content of the layer.
  42. gfx::Rect visible_drawable_content_rect;
  43. // In target surface space, the original rect that clipped this layer. This
  44. // value is used to avoid unnecessarily changing GL scissor state.
  45. gfx::Rect clip_rect;
  46. // Contains a mask information applied to the layer. The coordinates is in the
  47. // target space of the layer.
  48. gfx::MaskFilterInfo mask_filter_info;
  49. };
  50. } // namespace cc
  51. #endif // CC_LAYERS_DRAW_PROPERTIES_H_