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

Side by Side Diff: src/core/SkImageInfo.cpp

Issue 2101983003: remove SK_SUPPORT_LEGACY_COLORPROFILETYPE dead-code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « include/core/SkImageInfo.h ('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 2010 Google Inc. 2 * Copyright 2010 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 #include "SkImageInfo.h" 8 #include "SkImageInfo.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
11 11
12 #ifdef SK_SUPPORT_LEGACY_COLORPROFILETYPE
13 SkColorProfileType SkImageInfo::profileType() const {
14 return fColorSpace && fColorSpace->gammaCloseToSRGB()
15 ? kSRGB_SkColorProfileType : kLinear_SkColorProfileType;
16 }
17 #endif
18
19 static bool alpha_type_is_valid(SkAlphaType alphaType) { 12 static bool alpha_type_is_valid(SkAlphaType alphaType) {
20 return (alphaType >= 0) && (alphaType <= kLastEnum_SkAlphaType); 13 return (alphaType >= 0) && (alphaType <= kLastEnum_SkAlphaType);
21 } 14 }
22 15
23 static bool color_type_is_valid(SkColorType colorType) { 16 static bool color_type_is_valid(SkColorType colorType) {
24 return (colorType >= 0) && (colorType <= kLastEnum_SkColorType); 17 return (colorType >= 0) && (colorType <= kLastEnum_SkColorType);
25 } 18 }
26 19
27 SkImageInfo SkImageInfo::MakeS32(int width, int height, SkAlphaType at) { 20 SkImageInfo SkImageInfo::MakeS32(int width, int height, SkAlphaType at) {
28 return SkImageInfo(width, height, kN32_SkColorType, at, 21 return SkImageInfo(width, height, kN32_SkColorType, at,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 126 }
134 // here x,y are either 0 or negative 127 // here x,y are either 0 or negative
135 fPixels = ((char*)fPixels - y * fRowBytes - x * fInfo.bytesPerPixel()); 128 fPixels = ((char*)fPixels - y * fRowBytes - x * fInfo.bytesPerPixel());
136 // the intersect may have shrunk info's logical size 129 // the intersect may have shrunk info's logical size
137 fInfo = fInfo.makeWH(srcR.width(), srcR.height()); 130 fInfo = fInfo.makeWH(srcR.width(), srcR.height());
138 fX = srcR.x(); 131 fX = srcR.x();
139 fY = srcR.y(); 132 fY = srcR.y();
140 133
141 return true; 134 return true;
142 } 135 }
OLDNEW
« no previous file with comments | « include/core/SkImageInfo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698