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

Side by Side 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, 5 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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_TEST_PICTURE_CACHE_MODEL_H_
6 #define CC_TEST_PICTURE_CACHE_MODEL_H_
7
8 #include <stdint.h>
9
10 #include <unordered_map>
11
12 #include "base/macros.h"
13 #include "third_party/skia/include/core/SkRefCnt.h"
14
15 class SkPicture;
16
17 namespace cc {
18
19 // PictureCacheModel provides a way for sharing a cache between an engine
20 // and the client. When the FakeEnginePictureCache and the ClientPictureCache
21 // point to the same PictureCacheModel, the calls to AddPicture on the
22 // engine make an SkPicture available through GetPicture on the client.
23 class PictureCacheModel {
24 public:
25 PictureCacheModel();
26 ~PictureCacheModel();
27
28 void AddPicture(const SkPicture* picture);
29
30 sk_sp<const SkPicture> GetPicture(uint32_t unique_id);
31
32 private:
33 std::unordered_map<uint32_t, sk_sp<const SkPicture>> pictures_;
34
35 DISALLOW_COPY_AND_ASSIGN(PictureCacheModel);
36 };
37
38 } // namespace cc
39
40 #endif // CC_TEST_PICTURE_CACHE_MODEL_H_
OLDNEW
« 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