| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 CC_PAINT_PAINT_OP_BUFFER_H_ | 5 #ifndef CC_PAINT_PAINT_OP_BUFFER_H_ |
| 6 #define CC_PAINT_PAINT_OP_BUFFER_H_ | 6 #define CC_PAINT_PAINT_OP_BUFFER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/aligned_memory.h" | 11 #include "base/memory/aligned_memory.h" |
| 12 #include "cc/paint/discardable_image_map.h" |
| 12 #include "cc/paint/paint_canvas.h" | 13 #include "cc/paint/paint_canvas.h" |
| 13 #include "cc/paint/paint_export.h" | 14 #include "cc/paint/paint_export.h" |
| 14 #include "cc/paint/paint_flags.h" | 15 #include "cc/paint/paint_flags.h" |
| 15 #include "third_party/skia/include/core/SkPicture.h" | 16 #include "third_party/skia/include/core/SkPicture.h" |
| 16 #include "third_party/skia/include/core/SkRect.h" | 17 #include "third_party/skia/include/core/SkRect.h" |
| 17 #include "third_party/skia/include/core/SkTextBlob.h" | 18 #include "third_party/skia/include/core/SkTextBlob.h" |
| 18 | 19 |
| 19 // PaintOpBuffer is a reimplementation of SkLiteDL. | 20 // PaintOpBuffer is a reimplementation of SkLiteDL. |
| 20 // See: third_party/skia/src/core/SkLiteDL.h. | 21 // See: third_party/skia/src/core/SkLiteDL.h. |
| 21 | 22 |
| 22 namespace cc { | 23 namespace cc { |
| 23 | 24 class DiscardableImageStore; |
| 24 class DisplayItemList; | 25 class DisplayItemList; |
| 25 | 26 |
| 26 class CC_PAINT_EXPORT ThreadsafeMatrix : public SkMatrix { | 27 class CC_PAINT_EXPORT ThreadsafeMatrix : public SkMatrix { |
| 27 public: | 28 public: |
| 28 explicit ThreadsafeMatrix(const SkMatrix& matrix) : SkMatrix(matrix) { | 29 explicit ThreadsafeMatrix(const SkMatrix& matrix) : SkMatrix(matrix) { |
| 29 (void)getType(); | 30 (void)getType(); |
| 30 } | 31 } |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 class CC_PAINT_EXPORT ThreadsafePath : public SkPath { | 34 class CC_PAINT_EXPORT ThreadsafePath : public SkPath { |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 void playback(SkCanvas* canvas) const; | 570 void playback(SkCanvas* canvas) const; |
| 570 void playback(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 571 void playback(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
| 571 | 572 |
| 572 // TODO(enne): These are no longer approximate. Rename these. | 573 // TODO(enne): These are no longer approximate. Rename these. |
| 573 int approximateOpCount() const { return op_count_; } | 574 int approximateOpCount() const { return op_count_; } |
| 574 size_t approximateBytesUsed() const { | 575 size_t approximateBytesUsed() const { |
| 575 return sizeof(*this) + reserved_ + subrecord_bytes_used_; | 576 return sizeof(*this) + reserved_ + subrecord_bytes_used_; |
| 576 } | 577 } |
| 577 int numSlowPaths() const { return num_slow_paths_; } | 578 int numSlowPaths() const { return num_slow_paths_; } |
| 578 bool HasDiscardableImages() const { return has_discardable_images_; } | 579 bool HasDiscardableImages() const { return has_discardable_images_; } |
| 580 void GatherDiscardableImages(DiscardableImageStore* image_store) const; |
| 579 | 581 |
| 580 // Resize the PaintOpBuffer to exactly fit the current amount of used space. | 582 // Resize the PaintOpBuffer to exactly fit the current amount of used space. |
| 581 void ShrinkToFit(); | 583 void ShrinkToFit(); |
| 582 | 584 |
| 583 const SkRect& cullRect() const { return cull_rect_; } | 585 const SkRect& cullRect() const { return cull_rect_; } |
| 584 | 586 |
| 585 PaintOp* GetFirstOp() const { | 587 PaintOp* GetFirstOp() const { |
| 586 return const_cast<PaintOp*>(first_op_.data_as<PaintOp>()); | 588 return const_cast<PaintOp*>(first_op_.data_as<PaintOp>()); |
| 587 } | 589 } |
| 588 | 590 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 size_t subrecord_bytes_used_ = 0; | 820 size_t subrecord_bytes_used_ = 0; |
| 819 bool has_discardable_images_ = false; | 821 bool has_discardable_images_ = false; |
| 820 SkRect cull_rect_; | 822 SkRect cull_rect_; |
| 821 | 823 |
| 822 DISALLOW_COPY_AND_ASSIGN(PaintOpBuffer); | 824 DISALLOW_COPY_AND_ASSIGN(PaintOpBuffer); |
| 823 }; | 825 }; |
| 824 | 826 |
| 825 } // namespace cc | 827 } // namespace cc |
| 826 | 828 |
| 827 #endif // CC_PAINT_PAINT_OP_BUFFER_H_ | 829 #endif // CC_PAINT_PAINT_OP_BUFFER_H_ |
| OLD | NEW |