Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 5 #ifndef CC_PAINT_DISCARDABLE_IMAGE_STORE_H_ | |
| 6 #define CC_PAINT_DISCARDABLE_IMAGE_STORE_H_ | |
| 7 | |
| 8 #include "cc/paint/paint_export.h" | |
| 9 #include "cc/paint/paint_op_buffer.h" | |
| 10 #include "third_party/skia/include/core/SkCanvas.h" | |
| 11 #include "third_party/skia/include/core/SkMatrix.h" | |
| 12 #include "third_party/skia/include/core/SkRect.h" | |
| 13 | |
| 14 namespace cc { | |
| 15 class PaintFlags; | |
| 16 class PaintImage; | |
| 17 | |
| 18 class CC_PAINT_EXPORT DiscardableImageStore { | |
| 19 public: | |
| 20 DiscardableImageStore( | |
| 21 int width, | |
| 22 int height, | |
| 23 std::vector<std::pair<DrawImage, gfx::Rect>>* image_set, | |
| 24 std::unordered_map<ImageId, gfx::Rect>* image_id_to_rect); | |
| 25 ~DiscardableImageStore(); | |
| 26 | |
| 27 void GatherDiscardableImages(const PaintOpBuffer* buffer); | |
| 28 SkCanvas* NoDrawCanvas(); | |
|
vmpstr
2017/04/28 16:40:11
nit: GetNoDrawCanvas() or just GetCanvas()? or can
Khushal
2017/05/03 21:07:07
The no draw part was just to make it clear that it
vmpstr
2017/05/05 18:56:20
I think we can do that second step as a follow up.
Khushal
2017/05/05 21:54:12
Done.
| |
| 29 | |
| 30 private: | |
| 31 class PaintTrackingCanvas; | |
| 32 | |
| 33 void AddImageFromFlags(const SkRect& rect, const PaintFlags& flags); | |
| 34 void AddImage(const PaintImage& paint_image, | |
| 35 const SkRect& src_rect, | |
| 36 const SkRect& rect, | |
| 37 const SkMatrix* local_matrix, | |
| 38 const PaintFlags& flags); | |
| 39 | |
| 40 // This canvas is used only for tracking transform/clip/filter state from the | |
| 41 // non-drawing ops. | |
| 42 std::unique_ptr<PaintTrackingCanvas> canvas_; | |
| 43 std::vector<std::pair<DrawImage, gfx::Rect>>* image_set_; | |
| 44 std::unordered_map<ImageId, gfx::Rect>* image_id_to_rect_; | |
| 45 }; | |
| 46 | |
| 47 } // namespace cc | |
| 48 | |
| 49 #endif // CC_PAINT_DISCARDABLE_IMAGE_STORE_H_ | |
| OLD | NEW |