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

Unified Diff: cc/test/picture_cache_model.h

Issue 1982893002: [blimp] Add SkPicture caching support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from vmpstr, including adding //cc/blimp Created 4 years, 6 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/test/layer_tree_test.cc ('k') | cc/test/picture_cache_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/picture_cache_model.h
diff --git a/cc/test/picture_cache_model.h b/cc/test/picture_cache_model.h
new file mode 100644
index 0000000000000000000000000000000000000000..d60a4fcb5fd40656bbc7e57bb4598ac59b161848
--- /dev/null
+++ b/cc/test/picture_cache_model.h
@@ -0,0 +1,40 @@
+// Copyright 2016 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_TEST_PICTURE_CACHE_MODEL_H_
+#define CC_TEST_PICTURE_CACHE_MODEL_H_
+
+#include <stdint.h>
+
+#include <unordered_map>
+
+#include "base/macros.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
+
+class SkPicture;
+
+namespace cc {
+
+// PictureCacheModel provides a way for sharing a cache between an engine
+// and the client. When the FakeEnginePictureCache and the ClientPictureCache
+// point to the same PictureCacheModel, the calls to AddPicture on the
+// engine make an SkPicture available through GetPicture on the client.
+class PictureCacheModel {
+ public:
+ PictureCacheModel();
+ ~PictureCacheModel();
+
+ void AddPicture(const SkPicture* picture);
+
+ sk_sp<const SkPicture> GetPicture(uint32_t unique_id);
+
+ private:
+ std::unordered_map<uint32_t, sk_sp<const SkPicture>> pictures_;
+
+ DISALLOW_COPY_AND_ASSIGN(PictureCacheModel);
+};
+
+} // namespace cc
+
+#endif // CC_TEST_PICTURE_CACHE_MODEL_H_
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/picture_cache_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698