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

Side by Side Diff: include/core/SkBitmap.h

Issue 1920423002: Prototype code that turns any/every flattenable into JSON (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix copyright dates in new files Created 4 years, 7 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 | « gyp/tests.gypi ('k') | include/core/SkWriteBuffer.h » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkBitmap_DEFINED 8 #ifndef SkBitmap_DEFINED
9 #define SkBitmap_DEFINED 9 #define SkBitmap_DEFINED
10 10
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 uint8_t fFlags; 767 uint8_t fFlags;
768 768
769 /* Unreference any pixelrefs or colortables 769 /* Unreference any pixelrefs or colortables
770 */ 770 */
771 void freePixels(); 771 void freePixels();
772 void updatePixelsFromRef() const; 772 void updatePixelsFromRef() const;
773 773
774 static void WriteRawPixels(SkWriteBuffer*, const SkBitmap&); 774 static void WriteRawPixels(SkWriteBuffer*, const SkBitmap&);
775 static bool ReadRawPixels(SkReadBuffer*, SkBitmap*); 775 static bool ReadRawPixels(SkReadBuffer*, SkBitmap*);
776 776
777 friend class SkReadBuffer; // unflatten, rawpixels 777 friend class SkReadBuffer; // unflatten, rawpixels
778 friend class SkWriteBuffer; // rawpixels 778 friend class SkBinaryWriteBuffer; // rawpixels
779 friend struct SkBitmapProcState; 779 friend struct SkBitmapProcState;
780 }; 780 };
781 781
782 class SkAutoLockPixels : SkNoncopyable { 782 class SkAutoLockPixels : SkNoncopyable {
783 public: 783 public:
784 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) { 784 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) {
785 fDidLock = doLock; 785 fDidLock = doLock;
786 if (doLock) { 786 if (doLock) {
787 bm.lockPixels(); 787 bm.lockPixels();
788 } 788 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 825
826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
827 SkASSERT(fPixels); 827 SkASSERT(fPixels);
828 SkASSERT(kIndex_8_SkColorType == this->colorType()); 828 SkASSERT(kIndex_8_SkColorType == this->colorType());
829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
830 SkASSERT(fColorTable); 830 SkASSERT(fColorTable);
831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
832 } 832 }
833 833
834 #endif 834 #endif
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | include/core/SkWriteBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698