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

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

Issue 103753007: Revert of Change SkDecodingImageGenerator API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/lazy/SkCachingPixelRef.cpp ('k') | src/lazy/SkDiscardablePixelRef.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 SkDiscardablePixelRef_DEFINED 8 #ifndef SkDiscardablePixelRef_DEFINED
9 #define SkDiscardablePixelRef_DEFINED 9 #define SkDiscardablePixelRef_DEFINED
10 10
11 #include "SkDiscardableMemory.h" 11 #include "SkDiscardableMemory.h"
12 #include "SkImageGenerator.h" 12 #include "SkImageGenerator.h"
13 #include "SkImageInfo.h" 13 #include "SkImageInfo.h"
14 #include "SkPixelRef.h" 14 #include "SkPixelRef.h"
15 15
16 /**
17 * A PixelRef backed by SkDiscardableMemory, with the ability to
18 * re-generate the pixels (via a SkImageGenerator) if the DM is
19 * purged.
20 *
21 * Since SkColorTable is reference-counted, we do not support indexed
22 * color with this class; there would be no way for the discardable
23 * memory system to unref the color table.
24 */
25 class SkDiscardablePixelRef : public SkPixelRef { 16 class SkDiscardablePixelRef : public SkPixelRef {
26 public: 17 public:
27 SK_DECLARE_UNFLATTENABLE_OBJECT() 18 SK_DECLARE_UNFLATTENABLE_OBJECT()
28 19
29 protected: 20 protected:
30 ~SkDiscardablePixelRef(); 21 ~SkDiscardablePixelRef();
31 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE; 22 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE;
32 virtual void onUnlockPixels() SK_OVERRIDE; 23 virtual void onUnlockPixels() SK_OVERRIDE;
33 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } 24 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; }
34 25
(...skipping 13 matching lines...) Expand all
48 /* Takes ownership of SkImageGenerator. */ 39 /* Takes ownership of SkImageGenerator. */
49 SkDiscardablePixelRef(const SkImageInfo&, SkImageGenerator*, 40 SkDiscardablePixelRef(const SkImageInfo&, SkImageGenerator*,
50 size_t rowBytes, 41 size_t rowBytes,
51 SkDiscardableMemory::Factory* factory); 42 SkDiscardableMemory::Factory* factory);
52 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, 43 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*,
53 SkBitmap*, 44 SkBitmap*,
54 SkDiscardableMemory::Factory*); 45 SkDiscardableMemory::Factory*);
55 typedef SkPixelRef INHERITED; 46 typedef SkPixelRef INHERITED;
56 }; 47 };
57 #endif // SkDiscardablePixelRef_DEFINED 48 #endif // SkDiscardablePixelRef_DEFINED
OLDNEW
« no previous file with comments | « src/lazy/SkCachingPixelRef.cpp ('k') | src/lazy/SkDiscardablePixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698