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

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

Issue 134163010: Refactor read and write buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: original write flags were fine Created 6 years, 10 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
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bool onNewLockPixels(LockRec*) SK_OVERRIDE; 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() SK_OVERRIDE {} 77 virtual void onUnlockPixels() SK_OVERRIDE {}
78 78
79 SkImageRef(SkFlattenableReadBuffer&, SkBaseMutex* mutex = NULL); 79 SkImageRef(SkReadBuffer&, SkBaseMutex* mutex = NULL);
80 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 80 virtual void flatten(SkWriteBuffer&) 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 int fSampleSize; 92 int fSampleSize;
93 bool fDoDither; 93 bool fDoDither;
94 bool fErrorInDecoding; 94 bool fErrorInDecoding;
95 95
96 friend class SkImageRefPool; 96 friend class SkImageRefPool;
97 97
98 SkImageRef* fPrev, *fNext; 98 SkImageRef* fPrev, *fNext;
99 size_t ramUsed() const; 99 size_t ramUsed() const;
100 100
101 typedef SkPixelRef INHERITED; 101 typedef SkPixelRef INHERITED;
102 }; 102 };
103 103
104 #endif 104 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698