SkAnnotation.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2012 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SkAnnotation_DEFINED
  8. #define SkAnnotation_DEFINED
  9. #include "SkTypes.h"
  10. class SkData;
  11. struct SkPoint;
  12. struct SkRect;
  13. class SkCanvas;
  14. /**
  15. * Annotate the canvas by associating the specified URL with the
  16. * specified rectangle (in local coordinates, just like drawRect).
  17. *
  18. * If the backend of this canvas does not support annotations, this call is
  19. * safely ignored.
  20. *
  21. * The caller is responsible for managing its ownership of the SkData.
  22. */
  23. SK_API void SkAnnotateRectWithURL(SkCanvas*, const SkRect&, SkData*);
  24. /**
  25. * Annotate the canvas by associating a name with the specified point.
  26. *
  27. * If the backend of this canvas does not support annotations, this call is
  28. * safely ignored.
  29. *
  30. * The caller is responsible for managing its ownership of the SkData.
  31. */
  32. SK_API void SkAnnotateNamedDestination(SkCanvas*, const SkPoint&, SkData*);
  33. /**
  34. * Annotate the canvas by making the specified rectangle link to a named
  35. * destination.
  36. *
  37. * If the backend of this canvas does not support annotations, this call is
  38. * safely ignored.
  39. *
  40. * The caller is responsible for managing its ownership of the SkData.
  41. */
  42. SK_API void SkAnnotateLinkToDestination(SkCanvas*, const SkRect&, SkData*);
  43. #endif