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

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

Issue 374743003: Skia side RGB to YUV gpu conversion (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« src/gpu/SkGr.cpp ('K') | « src/gpu/SkGr.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 #ifndef SkDiscardablePixelRef_DEFINED 8 #ifndef SkDiscardablePixelRef_DEFINED
9 #define SkDiscardablePixelRef_DEFINED 9 #define SkDiscardablePixelRef_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 ~SkDiscardablePixelRef(); 29 ~SkDiscardablePixelRef();
30 30
31 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE; 31 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
32 virtual void onUnlockPixels() SK_OVERRIDE; 32 virtual void onUnlockPixels() SK_OVERRIDE;
33 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; } 33 virtual bool onLockPixelsAreWritable() const SK_OVERRIDE { return false; }
34 34
35 virtual SkData* onRefEncodedData() SK_OVERRIDE { 35 virtual SkData* onRefEncodedData() SK_OVERRIDE {
36 return fGenerator->refEncodedData(); 36 return fGenerator->refEncodedData();
37 } 37 }
38 38
39 virtual SkImageGenerator* getImageGenerator() const SK_OVERRIDE {
40 return fGenerator;
41 }
42
39 private: 43 private:
40 SkImageGenerator* const fGenerator; 44 SkImageGenerator* const fGenerator;
41 SkDiscardableMemory::Factory* const fDMFactory; 45 SkDiscardableMemory::Factory* const fDMFactory;
42 const size_t fRowBytes; 46 const size_t fRowBytes;
43 // These const members should not change over the life of the 47 // These const members should not change over the life of the
44 // PixelRef, since the SkBitmap doesn't expect them to change. 48 // PixelRef, since the SkBitmap doesn't expect them to change.
45 49
46 SkDiscardableMemory* fDiscardableMemory; 50 SkDiscardableMemory* fDiscardableMemory;
47 SkAutoTUnref<SkColorTable> fCTable; 51 SkAutoTUnref<SkColorTable> fCTable;
48 52
49 /* Takes ownership of SkImageGenerator. */ 53 /* Takes ownership of SkImageGenerator. */
50 SkDiscardablePixelRef(const SkImageInfo&, SkImageGenerator*, 54 SkDiscardablePixelRef(const SkImageInfo&, SkImageGenerator*,
51 size_t rowBytes, 55 size_t rowBytes,
52 SkDiscardableMemory::Factory* factory); 56 SkDiscardableMemory::Factory* factory);
53 57
54 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap*, 58 friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap*,
55 SkDiscardableMemory::Factory*); 59 SkDiscardableMemory::Factory*);
56 60
57 typedef SkPixelRef INHERITED; 61 typedef SkPixelRef INHERITED;
58 }; 62 };
59 63
60 #endif // SkDiscardablePixelRef_DEFINED 64 #endif // SkDiscardablePixelRef_DEFINED
OLDNEW
« src/gpu/SkGr.cpp ('K') | « src/gpu/SkGr.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698