Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3610)

Unified Diff: cc/paint/discardable_image_store.h

Issue 2842333003: cc: Update discardable image metadata generation to get PaintImages. (Closed)
Patch Set: win Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/paint/discardable_image_map_unittest.cc ('k') | cc/paint/discardable_image_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/discardable_image_store.h
diff --git a/cc/paint/discardable_image_store.h b/cc/paint/discardable_image_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c26e79e57653e22e29435d7492ba40f4fceb81c
--- /dev/null
+++ b/cc/paint/discardable_image_store.h
@@ -0,0 +1,51 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_PAINT_DISCARDABLE_IMAGE_STORE_H_
+#define CC_PAINT_DISCARDABLE_IMAGE_STORE_H_
+
+#include "base/containers/flat_map.h"
+#include "cc/paint/draw_image.h"
+#include "cc/paint/image_id.h"
+#include "cc/paint/paint_export.h"
+#include "cc/paint/paint_op_buffer.h"
+#include "third_party/skia/include/core/SkMatrix.h"
+#include "third_party/skia/include/core/SkRect.h"
+#include "third_party/skia/include/utils/SkNoDrawCanvas.h"
+
+namespace cc {
+class PaintFlags;
+class PaintImage;
+
+class CC_PAINT_EXPORT DiscardableImageStore {
+ public:
+ DiscardableImageStore(int width,
+ int height,
+ std::vector<std::pair<DrawImage, gfx::Rect>>* image_set,
+ base::flat_map<ImageId, gfx::Rect>* image_id_to_rect);
+ ~DiscardableImageStore();
+
+ void GatherDiscardableImages(const PaintOpBuffer* buffer);
+ SkNoDrawCanvas* GetNoDrawCanvas();
+
+ private:
+ class PaintTrackingCanvas;
+
+ void AddImageFromFlags(const SkRect& rect, const PaintFlags& flags);
+ void AddImage(const PaintImage& paint_image,
+ const SkRect& src_rect,
+ const SkRect& rect,
+ const SkMatrix* local_matrix,
+ const PaintFlags& flags);
+
+ // This canvas is used only for tracking transform/clip/filter state from the
+ // non-drawing ops.
+ std::unique_ptr<PaintTrackingCanvas> canvas_;
+ std::vector<std::pair<DrawImage, gfx::Rect>>* image_set_;
+ base::flat_map<ImageId, gfx::Rect>* image_id_to_rect_;
+};
+
+} // namespace cc
+
+#endif // CC_PAINT_DISCARDABLE_IMAGE_STORE_H_
« no previous file with comments | « cc/paint/discardable_image_map_unittest.cc ('k') | cc/paint/discardable_image_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698