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

Side by Side Diff: cc/test/fake_engine_picture_cache.cc

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/test/fake_engine_picture_cache.h ('k') | cc/test/fake_image_serialization_processor.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 #include "cc/test/fake_engine_picture_cache.h"
6
7 #include <map>
8 #include <memory>
9
10 #include "cc/blimp/picture_data.h"
11 #include "cc/playback/display_item_list.h"
12 #include "cc/test/picture_cache_model.h"
13 #include "third_party/skia/include/core/SkPicture.h"
14
15 namespace cc {
16
17 FakeEnginePictureCache::FakeEnginePictureCache(PictureCacheModel* model)
18 : model_(model) {}
19
20 FakeEnginePictureCache::~FakeEnginePictureCache() {}
21
22 void FakeEnginePictureCache::MarkAllSkPicturesAsUsed(
23 const DisplayItemList* display_list) {
24 if (!display_list)
25 return;
26
27 for (auto it = display_list->begin(); it != display_list->end(); ++it) {
28 sk_sp<const SkPicture> picture = it->GetPicture();
29 if (!picture)
30 continue;
31
32 MarkUsed(picture.get());
33 }
34 }
35
36 const std::vector<uint32_t>& FakeEnginePictureCache::GetAllUsedPictureIds() {
37 return used_picture_ids_;
38 }
39
40 void FakeEnginePictureCache::MarkUsed(const SkPicture* picture) {
41 if (model_)
42 model_->AddPicture(picture);
43 used_picture_ids_.push_back(picture->uniqueID());
44 }
45
46 std::vector<PictureData>
47 FakeEnginePictureCache::CalculateCacheUpdateAndFlush() {
48 return std::vector<PictureData>();
49 }
50
51 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_engine_picture_cache.h ('k') | cc/test/fake_image_serialization_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698