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

Side by Side Diff: src/core/SkImageFilterCacheKey.h

Issue 1919063002: Image filters: de-nest SkImageFilter::Cache and Cache::Key. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix copyright Created 4 years, 7 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 | « src/core/SkImageFilterCache.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('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 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkImageFilterCacheKey_DEFINED
9 #define SkImageFilterCacheKey_DEFINED
10
11 struct SkImageFilter::Cache::Key {
12 Key(const uint32_t uniqueID, const SkMatrix& matrix,
13 const SkIRect& clipBounds, uint32_t srcGenID, const SkIRect& srcSubset)
14 : fUniqueID(uniqueID)
15 , fMatrix(matrix)
16 , fClipBounds(clipBounds)
17 , fSrcGenID(srcGenID)
18 , fSrcSubset(srcSubset) {
19 // Assert that Key is tightly-packed, since it is hashed.
20 static_assert(sizeof(Key) == sizeof(uint32_t) + sizeof(SkMatrix) + sizeo f(SkIRect) +
21 sizeof(uint32_t) + 4 * sizeof(int32_t),
22 "image_filter_key_tight_packing");
23 fMatrix.getType(); // force initialization of type, so hashes match
24 }
25
26 uint32_t fUniqueID;
27 SkMatrix fMatrix;
28 SkIRect fClipBounds;
29 uint32_t fSrcGenID;
30 SkIRect fSrcSubset;
31
32 bool operator==(const Key& other) const {
33 return fUniqueID == other.fUniqueID &&
34 fMatrix == other.fMatrix &&
35 fClipBounds == other.fClipBounds &&
36 fSrcGenID == other.fSrcGenID &&
37 fSrcSubset == other.fSrcSubset;
38 }
39 };
40
41 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageFilterCache.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698