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

Side by Side Diff: tools/LazyDecodeBitmap.cpp

Issue 54363008: move SkImage::ColorType into SkColorType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 #include "LazyDecodeBitmap.h" 8 #include "LazyDecodeBitmap.h"
9 9
10 #include "PictureRenderingFlags.h" // --deferImageDecoding is defined here. 10 #include "PictureRenderingFlags.h" // --deferImageDecoding is defined here.
(...skipping 22 matching lines...) Expand all
33 33
34 public: 34 public:
35 CacheSelector() { 35 CacheSelector() {
36 fPurgeableImageCache = SkPurgeableImageCache::Create(); 36 fPurgeableImageCache = SkPurgeableImageCache::Create();
37 } 37 }
38 38
39 ~CacheSelector() { 39 ~CacheSelector() {
40 SkSafeUnref(fPurgeableImageCache); 40 SkSafeUnref(fPurgeableImageCache);
41 } 41 }
42 42
43 virtual SkImageCache* selectCache(const SkImage::Info& info) SK_OVERRIDE { 43 virtual SkImageCache* selectCache(const SkImageInfo& info) SK_OVERRIDE {
44 if (info.fWidth * info.fHeight > 32 * 1024 && fPurgeableImageCache != NU LL) { 44 if (info.fWidth * info.fHeight > 32 * 1024 && fPurgeableImageCache != NU LL) {
45 return fPurgeableImageCache; 45 return fPurgeableImageCache;
46 } 46 }
47 return &gLruImageCache; 47 return &gLruImageCache;
48 } 48 }
49 private: 49 private:
50 SkImageCache* fPurgeableImageCache; 50 SkImageCache* fPurgeableImageCache;
51 }; 51 };
52 52
53 static CacheSelector gCacheSelector; 53 static CacheSelector gCacheSelector;
(...skipping 13 matching lines...) Expand all
67 gFactory.setCacheSelector(&gCacheSelector); 67 gFactory.setCacheSelector(&gCacheSelector);
68 } else { 68 } else {
69 gFactory.setImageCache(&gLruImageCache); 69 gFactory.setImageCache(&gLruImageCache);
70 } 70 }
71 gOnce = true; 71 gOnce = true;
72 } 72 }
73 return gFactory.installPixelRef(data, bitmap); 73 return gFactory.installPixelRef(data, bitmap);
74 } 74 }
75 75
76 } // namespace sk_tools 76 } // namespace sk_tools
OLDNEW
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698