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

Side by Side Diff: blimp/test/support/compositor/picture_cache_test_support.h

Issue 1982893002: [blimp] Add SkPicture caching support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from kmarshall 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
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 BLIMP_TEST_SUPPORT_COMPOSITOR_PICTURE_CACHE_TEST_SUPPORT_H_
6 #define BLIMP_TEST_SUPPORT_COMPOSITOR_PICTURE_CACHE_TEST_SUPPORT_H_
7
8 #include "blimp/common/blob_cache/blob_cache.h"
9 #include "cc/proto/picture_cache.h"
10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "third_party/skia/include/core/SkColor.h"
Kevin M 2016/06/21 21:35:04 switch these to forward declares where possible?
nyquist 2016/06/24 11:11:15 Sadly, I need this for all of them :-/ SkColor is
12 #include "third_party/skia/include/core/SkPicture.h"
13 #include "third_party/skia/include/core/SkRefCnt.h"
14
15 namespace blimp {
16
17 // Creates an SkPicture filled with with the given |color|.
18 sk_sp<const SkPicture> CreateSkPicture(SkColor color);
19
20 // Serializes the given picture into an SkData object.
21 sk_sp<SkData> SerializePicture(sk_sp<const SkPicture> picture);
22
23 // Serializes an SkPicture and returns the BlobId for the serialized form of
24 // the picture.
25 BlobId GetBlobId(sk_sp<const SkPicture> picture);
26
27 // Deserializes the SkPicture represented by |data.
28 sk_sp<const SkPicture> DeserializePicture(sk_sp<SkData> data);
29
30 // Compares an SkPicture and SkPicture represented by the SkData in the
31 // cc::PictureData.
32 bool SamePicture(sk_sp<const SkPicture> picture,
Kevin M 2016/06/21 21:35:04 nittiest of nits: PicturesEqual() ?
nyquist 2016/06/24 11:11:15 Done.
33 const cc::PictureData& picture_data);
34
35 // Utility function to create a valid cc::PictureData from an SkPicture.
36 cc::PictureData CreatePictureData(sk_sp<const SkPicture> picture);
37
38 MATCHER_P(PictureMatches, picture, "") {
39 return SamePicture(picture, arg);
40 }
41
42 } // namespace blimp
43
44 #endif // BLIMP_TEST_SUPPORT_COMPOSITOR_PICTURE_CACHE_TEST_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698