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

Side by Side Diff: include/core/SkImageFilter.h

Issue 1514893003: Create a hash table from id<-->key in SkImageFilter::CacheImpl (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: clean up in ~CacheImpl Created 5 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
« no previous file with comments | « no previous file | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkImageFilter_DEFINED 8 #ifndef SkImageFilter_DEFINED
9 #define SkImageFilter_DEFINED 9 #define SkImageFilter_DEFINED
10 10
(...skipping 24 matching lines...) Expand all
35 // (result, offset). 35 // (result, offset).
36 class Cache : public SkRefCnt { 36 class Cache : public SkRefCnt {
37 public: 37 public:
38 struct Key; 38 struct Key;
39 virtual ~Cache() {} 39 virtual ~Cache() {}
40 static Cache* Create(size_t maxBytes); 40 static Cache* Create(size_t maxBytes);
41 static Cache* Get(); 41 static Cache* Get();
42 virtual bool get(const Key& key, SkBitmap* result, SkIPoint* offset) con st = 0; 42 virtual bool get(const Key& key, SkBitmap* result, SkIPoint* offset) con st = 0;
43 virtual void set(const Key& key, const SkBitmap& result, const SkIPoint& offset) = 0; 43 virtual void set(const Key& key, const SkBitmap& result, const SkIPoint& offset) = 0;
44 virtual void purge() {} 44 virtual void purge() {}
45 virtual void purgeByImageFilterId(uint32_t) {}
45 }; 46 };
46 47
47 enum SizeConstraint { 48 enum SizeConstraint {
48 kExact_SizeConstraint, 49 kExact_SizeConstraint,
49 kApprox_SizeConstraint, 50 kApprox_SizeConstraint,
50 }; 51 };
51 52
52 class Context { 53 class Context {
53 public: 54 public:
54 Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache, 55 Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache,
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 */ 452 */
452 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \ 453 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \
453 Common localVar; \ 454 Common localVar; \
454 do { \ 455 do { \
455 if (!localVar.unflatten(buffer, expectedCount)) { \ 456 if (!localVar.unflatten(buffer, expectedCount)) { \
456 return NULL; \ 457 return NULL; \
457 } \ 458 } \
458 } while (0) 459 } while (0)
459 460
460 #endif 461 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698