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

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

Issue 320873003: change pixelref to not inherit from SkFlattenable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 5 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/lazy/SkCachingPixelRef.h ('k') | src/ports/SkGlobalInitialization_default.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 /** 16 /**
17 * A PixelRef backed by SkDiscardableMemory, with the ability to 17 * A PixelRef backed by SkDiscardableMemory, with the ability to
18 * re-generate the pixels (via a SkImageGenerator) if the DM is 18 * re-generate the pixels (via a SkImageGenerator) if the DM is
19 * purged. 19 * purged.
20 */ 20 */
21 class SkDiscardablePixelRef : public SkPixelRef { 21 class SkDiscardablePixelRef : public SkPixelRef {
22 public: 22 public:
23 SK_DECLARE_INST_COUNT(SkDiscardablePixelRef) 23 SK_DECLARE_INST_COUNT(SkDiscardablePixelRef)
24 #ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
24 SK_DECLARE_UNFLATTENABLE_OBJECT() 25 SK_DECLARE_UNFLATTENABLE_OBJECT()
26 #endif
25 27
26 protected: 28 protected:
27 ~SkDiscardablePixelRef(); 29 ~SkDiscardablePixelRef();
28 30
29 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; 31 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
30 virtual void onUnlockPixels() SK_OVERRIDE; 32 virtual void onUnlockPixels() SK_OVERRIDE;
31 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } 33 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; }
32 34
33 virtual SkData* onRefEncodedData() SK_OVERRIDE { 35 virtual SkData* onRefEncodedData() SK_OVERRIDE {
34 return fGenerator->refEncodedData(); 36 return fGenerator->refEncodedData();
(...skipping 14 matching lines...) Expand all
49 size_t rowBytes, 51 size_t rowBytes,
50 SkDiscardableMemory::Factory* factory); 52 SkDiscardableMemory::Factory* factory);
51 53
52 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap*, 54 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap*,
53 SkDiscardableMemory::Factory*); 55 SkDiscardableMemory::Factory*);
54 56
55 typedef SkPixelRef INHERITED; 57 typedef SkPixelRef INHERITED;
56 }; 58 };
57 59
58 #endif // SkDiscardablePixelRef_DEFINED 60 #endif // SkDiscardablePixelRef_DEFINED
OLDNEW
« no previous file with comments | « src/lazy/SkCachingPixelRef.h ('k') | src/ports/SkGlobalInitialization_default.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698