paint_record.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2017 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_PAINT_PAINT_RECORD_H_
  5. #define CC_PAINT_PAINT_RECORD_H_
  6. #include "cc/paint/paint_export.h"
  7. #include "cc/paint/paint_op_buffer.h"
  8. #include "third_party/skia/include/core/SkPicture.h"
  9. namespace cc {
  10. class ImageProvider;
  11. // TODO(enne): Don't want to rename the world for this. Using these as the
  12. // same types for now prevents an extra allocation. Probably PaintRecord
  13. // will become an interface in the future.
  14. using PaintRecord = PaintOpBuffer;
  15. // TODO(enne): Remove these if possible, they are really expensive.
  16. CC_PAINT_EXPORT sk_sp<SkPicture> ToSkPicture(
  17. sk_sp<PaintRecord> record,
  18. const SkRect& bounds,
  19. ImageProvider* image_provider = nullptr,
  20. PlaybackParams::CustomDataRasterCallback callback =
  21. PlaybackParams::CustomDataRasterCallback());
  22. CC_PAINT_EXPORT sk_sp<const SkPicture> ToSkPicture(
  23. sk_sp<const PaintRecord> record,
  24. const SkRect& bounds,
  25. ImageProvider* image_provider = nullptr,
  26. PlaybackParams::CustomDataRasterCallback callback =
  27. PlaybackParams::CustomDataRasterCallback());
  28. } // namespace cc
  29. #endif // CC_PAINT_PAINT_RECORD_H_