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

Side by Side Diff: src/lazy/SkCachingPixelRef.h

Issue 507483002: retool image cache to be generic cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase + add comment in unlock Created 6 years, 3 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/SkScaledImageCache.cpp ('k') | src/lazy/SkCachingPixelRef.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 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 #ifndef SkCachingPixelRef_DEFINED 8 #ifndef SkCachingPixelRef_DEFINED
9 #define SkCachingPixelRef_DEFINED 9 #define SkCachingPixelRef_DEFINED
10 10
11 #include "SkBitmapCache.h"
11 #include "SkImageInfo.h" 12 #include "SkImageInfo.h"
12 #include "SkImageGenerator.h" 13 #include "SkImageGenerator.h"
13 #include "SkPixelRef.h" 14 #include "SkPixelRef.h"
14 15
15 class SkColorTable; 16 class SkColorTable;
16 17
17 /** 18 /**
18 * PixelRef which defers decoding until SkBitmap::lockPixels() is 19 * PixelRef which defers decoding until SkBitmap::lockPixels() is
19 * called. Caches the decoded images in the global 20 * called. Caches the decoded images in the global
20 * SkScaledImageCache. When the pixels are unlocked, this cache may 21 * SkScaledImageCache. When the pixels are unlocked, this cache may
(...skipping 24 matching lines...) Expand all
45 virtual void onUnlockPixels() SK_OVERRIDE; 46 virtual void onUnlockPixels() SK_OVERRIDE;
46 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } 47 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; }
47 48
48 virtual SkData* onRefEncodedData() SK_OVERRIDE { 49 virtual SkData* onRefEncodedData() SK_OVERRIDE {
49 return fImageGenerator->refEncodedData(); 50 return fImageGenerator->refEncodedData();
50 } 51 }
51 52
52 private: 53 private:
53 SkImageGenerator* const fImageGenerator; 54 SkImageGenerator* const fImageGenerator;
54 bool fErrorInDecoding; 55 bool fErrorInDecoding;
55 void* fScaledCacheId;
56 const size_t fRowBytes; 56 const size_t fRowBytes;
57 57
58 SkBitmap fLockedBitmap;
59
58 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes); 60 SkCachingPixelRef(const SkImageInfo&, SkImageGenerator*, size_t rowBytes);
59 61
60 typedef SkPixelRef INHERITED; 62 typedef SkPixelRef INHERITED;
61 }; 63 };
62 64
63 #endif // SkCachingPixelRef_DEFINED 65 #endif // SkCachingPixelRef_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkScaledImageCache.cpp ('k') | src/lazy/SkCachingPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698