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

Unified Diff: cc/test/fake_client_picture_cache.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/proto/layer_tree_host.proto ('k') | cc/test/fake_client_picture_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_client_picture_cache.h
diff --git a/cc/test/fake_client_picture_cache.h b/cc/test/fake_client_picture_cache.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c7d571776d1f3a407625a51a49cbdb5d2e30b0e
--- /dev/null
+++ b/cc/test/fake_client_picture_cache.h
@@ -0,0 +1,41 @@
+// 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_FAKE_CLIENT_PICTURE_CACHE_H_
+#define CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_
+
+#include <stdint.h>
+
+#include <map>
+#include <memory>
+
+#include "base/macros.h"
+#include "cc/blimp/client_picture_cache.h"
+
+namespace cc {
+class PictureCacheModel;
+
+class FakeClientPictureCache : public ClientPictureCache {
+ public:
+ explicit FakeClientPictureCache(PictureCacheModel* model);
+ ~FakeClientPictureCache() override;
+
+ const std::vector<uint32_t>& GetAllUsedPictureIds();
+
+ // ClientPictureCache implementation.
+ void MarkUsed(uint32_t engine_picture_id) override;
+ sk_sp<const SkPicture> GetPicture(uint32_t unique_id) override;
+ void ApplyCacheUpdate(const std::vector<PictureData>& cache_update) override;
+ void Flush() override;
+
+ private:
+ PictureCacheModel* model_;
+ std::vector<uint32_t> used_picture_ids_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeClientPictureCache);
+};
+
+} // namespace cc
+
+#endif // CC_TEST_FAKE_CLIENT_PICTURE_CACHE_H_
« no previous file with comments | « cc/proto/layer_tree_host.proto ('k') | cc/test/fake_client_picture_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698