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

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

Issue 791823003: Add sRGB texture support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add in changes for copy_to_new_texture_pixelref Created 6 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
« no previous file with comments | « no previous file | include/core/SkPixelRef.h » ('j') | include/core/SkPixelRef.h » ('J')
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void swap(SkBitmap& other); 65 void swap(SkBitmap& other);
66 66
67 /////////////////////////////////////////////////////////////////////////// 67 ///////////////////////////////////////////////////////////////////////////
68 68
69 const SkImageInfo& info() const { return fInfo; } 69 const SkImageInfo& info() const { return fInfo; }
70 70
71 int width() const { return fInfo.width(); } 71 int width() const { return fInfo.width(); }
72 int height() const { return fInfo.height(); } 72 int height() const { return fInfo.height(); }
73 SkColorType colorType() const { return fInfo.colorType(); } 73 SkColorType colorType() const { return fInfo.colorType(); }
74 SkAlphaType alphaType() const { return fInfo.alphaType(); } 74 SkAlphaType alphaType() const { return fInfo.alphaType(); }
75 SkColorProfileType profileType() const { return fInfo.profileType(); }
75 76
76 /** 77 /**
77 * Return the number of bytes per pixel based on the colortype. If the colo rtype is 78 * Return the number of bytes per pixel based on the colortype. If the colo rtype is
78 * kUnknown_SkColorType, then 0 is returned. 79 * kUnknown_SkColorType, then 0 is returned.
79 */ 80 */
80 int bytesPerPixel() const { return fInfo.bytesPerPixel(); } 81 int bytesPerPixel() const { return fInfo.bytesPerPixel(); }
81 82
82 /** 83 /**
83 * Return the rowbytes expressed as a number of pixels (like width and heig ht). 84 * Return the rowbytes expressed as a number of pixels (like width and heig ht).
84 * If the colortype is kUnknown_SkColorType, then 0 is returned. 85 * If the colortype is kUnknown_SkColorType, then 0 is returned.
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 810
810 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 811 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
811 SkASSERT(fPixels); 812 SkASSERT(fPixels);
812 SkASSERT(kIndex_8_SkColorType == this->colorType()); 813 SkASSERT(kIndex_8_SkColorType == this->colorType());
813 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 814 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
814 SkASSERT(fColorTable); 815 SkASSERT(fColorTable);
815 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 816 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
816 } 817 }
817 818
818 #endif 819 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkPixelRef.h » ('j') | include/core/SkPixelRef.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698