layer_selection_bound.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2014 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_INPUT_LAYER_SELECTION_BOUND_H_
  5. #define CC_INPUT_LAYER_SELECTION_BOUND_H_
  6. #include "cc/cc_export.h"
  7. #include "components/viz/common/quads/selection.h"
  8. #include "ui/gfx/geometry/point.h"
  9. #include "ui/gfx/selection_bound.h"
  10. namespace cc {
  11. // Marker for a selection end-point attached to a specific layer.
  12. // TODO(fsamuel): This could be unified with gfx::SelectionBound.
  13. struct CC_EXPORT LayerSelectionBound {
  14. LayerSelectionBound();
  15. ~LayerSelectionBound();
  16. gfx::SelectionBound::Type type;
  17. gfx::Point edge_start;
  18. gfx::Point edge_end;
  19. int layer_id;
  20. // Whether this bound is hidden (clipped out/occluded) within the painted
  21. // content of the layer (as opposed to being outside of the layer's bounds).
  22. bool hidden;
  23. std::string ToString() const;
  24. bool operator==(const LayerSelectionBound& other) const;
  25. bool operator!=(const LayerSelectionBound& other) const;
  26. };
  27. using LayerSelection = viz::Selection<LayerSelectionBound>;
  28. } // namespace cc
  29. #endif // CC_INPUT_LAYER_SELECTION_BOUND_H_