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

Side by Side Diff: cc/blimp/client_picture_cache.h

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_BLIMP_CLIENT_PICTURE_CACHE_H_ 5 #ifndef CC_BLIMP_CLIENT_PICTURE_CACHE_H_
6 #define CC_BLIMP_CLIENT_PICTURE_CACHE_H_ 6 #define CC_BLIMP_CLIENT_PICTURE_CACHE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "skia/ext/cdl_common.h"
10 #include "third_party/skia/include/core/SkRefCnt.h" 11 #include "third_party/skia/include/core/SkRefCnt.h"
11 12
12 class SkPicture;
13
14 namespace cc { 13 namespace cc {
15 struct PictureData; 14 struct PictureData;
16 15
17 // ClientPictureCache provides functionaltiy for marking when SkPictures are in 16 // ClientPictureCache provides functionaltiy for marking when SkPictures are in
18 // use an when they stop being in use. PictureCacheUpdates are provided 17 // 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 18 // 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 19 // used on the engine. The SkPictures are kept in memory until they are no
21 // longer in use. 20 // longer in use.
22 class ClientPictureCache { 21 class ClientPictureCache {
23 public: 22 public:
24 virtual ~ClientPictureCache() {} 23 virtual ~ClientPictureCache() {}
25 24
26 // MarkUsed must be called when the client has started using an SkPicture that 25 // MarkUsed must be called when the client has started using an SkPicture that
27 // was sent to from the engine. 26 // was sent to from the engine.
28 virtual void MarkUsed(uint32_t engine_picture_id) = 0; 27 virtual void MarkUsed(uint32_t engine_picture_id) = 0;
29 28
30 // Retrieves an SkPicture from the in-memory cache. It is required that the 29 // 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 30 // provided ID is the same as the unique ID that is given through the cache
32 // update. 31 // update.
33 virtual sk_sp<const SkPicture> GetPicture(uint32_t engine_picture_id) = 0; 32 virtual sk_sp<const CdlPicture> GetPicture(uint32_t engine_picture_id) = 0;
34 33
35 // Called when a PictureCacheUpdate has been retrieved from the engine. This 34 // Called when a PictureCacheUpdate has been retrieved from the engine. This
36 // must contain all the new SkPictures that are in use. 35 // must contain all the new SkPictures that are in use.
37 virtual void ApplyCacheUpdate(const std::vector<PictureData>& pictures) = 0; 36 virtual void ApplyCacheUpdate(const std::vector<PictureData>& pictures) = 0;
38 37
39 // Flushes the current state of the cache, removing unused SkPictures. Must be 38 // Flushes the current state of the cache, removing unused SkPictures. Must be
40 // called after deserialization is finished. 39 // called after deserialization is finished.
41 virtual void Flush() = 0; 40 virtual void Flush() = 0;
42 }; 41 };
43 42
44 } // namespace cc 43 } // namespace cc
45 44
46 #endif // CC_BLIMP_CLIENT_PICTURE_CACHE_H_ 45 #endif // CC_BLIMP_CLIENT_PICTURE_CACHE_H_
OLDNEW
« no previous file with comments | « apps/ui/views/app_window_frame_view.cc ('k') | cc/blimp/compositor_state_deserializer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698