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

Side by Side Diff: cc/blimp/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 unified diff | Download patch
« no previous file with comments | « cc/BUILD.gn ('k') | cc/blimp/engine_picture_cache.h » ('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_BLIMP_CLIENT_PICTURE_CACHE_H_
6 #define CC_BLIMP_CLIENT_PICTURE_CACHE_H_
7
8 #include <vector>
9
10 #include "third_party/skia/include/core/SkRefCnt.h"
11
12 class SkPicture;
13
14 namespace cc {
15 struct PictureData;
16
17 // ClientPictureCache provides functionaltiy for marking when SkPictures are in
18 // use an when they stop being in use. PictureCacheUpdates are provided
19 // with all new SkPictures that a client needs and the respective unique IDs
20 // used on the engine. The SkPictures are kept in memory until they are no
21 // longer in use.
22 class ClientPictureCache {
23 public:
24 virtual ~ClientPictureCache() {}
25
26 // MarkUsed must be called when the client has started using an SkPicture that
27 // was sent to from the engine.
28 virtual void MarkUsed(uint32_t engine_picture_id) = 0;
29
30 // Retrieves an SkPicture from the in-memory cache. It is required that the
31 // provided ID is the same as the unique ID that is given through the cache
32 // update.
33 virtual sk_sp<const SkPicture> GetPicture(uint32_t engine_picture_id) = 0;
34
35 // Called when a PictureCacheUpdate has been retrieved from the engine. This
36 // must contain all the new SkPictures that are in use.
37 virtual void ApplyCacheUpdate(const std::vector<PictureData>& pictures) = 0;
38
39 // Flushes the current state of the cache, removing unused SkPictures. Must be
40 // called after deserialization is finished.
41 virtual void Flush() = 0;
42 };
43
44 } // namespace cc
45
46 #endif // CC_BLIMP_CLIENT_PICTURE_CACHE_H_
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | cc/blimp/engine_picture_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698