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

Side by Side Diff: include/images/SkImageRef.h

Issue 68973005: Expand pixelref to return SkImageInfo and rowbytes (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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkImageRef_DEFINED 10 #ifndef SkImageRef_DEFINED
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 /** Override if you want to install a custom allocator. 65 /** Override if you want to install a custom allocator.
66 When this is called we will have already acquired the mutex! 66 When this is called we will have already acquired the mutex!
67 */ 67 */
68 virtual bool onDecode(SkImageDecoder* codec, SkStreamRewindable*, SkBitmap*, 68 virtual bool onDecode(SkImageDecoder* codec, SkStreamRewindable*, SkBitmap*,
69 SkBitmap::Config, SkImageDecoder::Mode); 69 SkBitmap::Config, SkImageDecoder::Mode);
70 70
71 /* Overrides from SkPixelRef 71 /* Overrides from SkPixelRef
72 When these are called, we will have already acquired the mutex! 72 When these are called, we will have already acquired the mutex!
73 */ 73 */
74 74
75 virtual void* onLockPixels(SkColorTable**); 75 virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
76 // override this in your subclass to clean up when we're unlocking pixels 76 // override this in your subclass to clean up when we're unlocking pixels
77 virtual void onUnlockPixels() {} 77 virtual void onUnlockPixels() SK_OVERRIDE {}
78 78
79 SkImageRef(SkFlattenableReadBuffer&, SkBaseMutex* mutex = NULL); 79 SkImageRef(SkFlattenableReadBuffer&, SkBaseMutex* mutex = NULL);
80 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 80 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
81 81
82 SkBitmap fBitmap; 82 SkBitmap fBitmap;
83 83
84 private: 84 private:
85 SkStreamRewindable* setStream(SkStreamRewindable*); 85 SkStreamRewindable* setStream(SkStreamRewindable*);
86 // called with mutex already held. returns true if the bitmap is in the 86 // called with mutex already held. returns true if the bitmap is in the
87 // requested state (or further, i.e. has pixels) 87 // requested state (or further, i.e. has pixels)
88 bool prepareBitmap(SkImageDecoder::Mode); 88 bool prepareBitmap(SkImageDecoder::Mode);
89 89
90 SkImageDecoderFactory* fFactory; // may be null 90 SkImageDecoderFactory* fFactory; // may be null
91 SkStreamRewindable* fStream; 91 SkStreamRewindable* fStream;
92 SkBitmap::Config fConfig; 92 SkBitmap::Config fConfig;
93 int fSampleSize; 93 int fSampleSize;
94 bool fDoDither; 94 bool fDoDither;
95 bool fErrorInDecoding; 95 bool fErrorInDecoding;
96 96
97 friend class SkImageRefPool; 97 friend class SkImageRefPool;
98 98
99 SkImageRef* fPrev, *fNext; 99 SkImageRef* fPrev, *fNext;
100 size_t ramUsed() const; 100 size_t ramUsed() const;
101 101
102 typedef SkPixelRef INHERITED; 102 typedef SkPixelRef INHERITED;
103 }; 103 };
104 104
105 #endif 105 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698