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: src/gpu/SkGpuDevice.cpp

Issue 2069173002: Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bad assert Created 4 years, 6 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 | « src/core/SkBitmap.cpp ('k') | src/gpu/SkGr.cpp » ('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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 origInfo.width() < 0 || origInfo.height() < 0) { 206 origInfo.width() < 0 || origInfo.height() < 0) {
207 return nullptr; 207 return nullptr;
208 } 208 }
209 209
210 if (!context) { 210 if (!context) {
211 return nullptr; 211 return nullptr;
212 } 212 }
213 213
214 SkColorType ct = origInfo.colorType(); 214 SkColorType ct = origInfo.colorType();
215 SkAlphaType at = origInfo.alphaType(); 215 SkAlphaType at = origInfo.alphaType();
216 SkColorProfileType pt = origInfo.profileType(); 216 SkColorSpace* cs = origInfo.colorSpace();
217 if (kRGB_565_SkColorType == ct || kGray_8_SkColorType == ct) { 217 if (kRGB_565_SkColorType == ct || kGray_8_SkColorType == ct) {
218 at = kOpaque_SkAlphaType; // force this setting 218 at = kOpaque_SkAlphaType; // force this setting
219 } 219 }
220 if (kOpaque_SkAlphaType != at) { 220 if (kOpaque_SkAlphaType != at) {
221 at = kPremul_SkAlphaType; // force this setting 221 at = kPremul_SkAlphaType; // force this setting
222 } 222 }
223 223
224 GrPixelConfig origConfig = SkImageInfo2GrPixelConfig(ct, at, pt, *context->c aps()); 224 GrPixelConfig origConfig = SkImageInfo2GrPixelConfig(ct, at, cs, *context->c aps());
225 if (!context->caps()->isConfigRenderable(origConfig, sampleCount > 0)) { 225 if (!context->caps()->isConfigRenderable(origConfig, sampleCount > 0)) {
226 // Fall back from whatever ct was to default of kRGBA or kBGRA which is aliased as kN32 226 // Fall back from whatever ct was to default of kRGBA or kBGRA which is aliased as kN32
227 ct = kN32_SkColorType; 227 ct = kN32_SkColorType;
228 } 228 }
229 229
230 GrPixelConfig config = SkImageInfo2GrPixelConfig(ct, at, pt, *context->caps( )); 230 GrPixelConfig config = SkImageInfo2GrPixelConfig(ct, at, cs, *context->caps( ));
231 231
232 return context->newDrawContext(SkBackingFit::kExact, // Why ex act? 232 return context->newDrawContext(SkBackingFit::kExact, // Why ex act?
233 origInfo.width(), origInfo.height(), 233 origInfo.width(), origInfo.height(),
234 config, sampleCount, 234 config, sampleCount,
235 kDefault_GrSurfaceOrigin, surfaceProps, budge ted); 235 kDefault_GrSurfaceOrigin, surfaceProps, budge ted);
236 236
237 } 237 }
238 238
239 // This method ensures that we always have a texture-backed "bitmap" when we fin ally 239 // This method ensures that we always have a texture-backed "bitmap" when we fin ally
240 // call through to the base impl so that the image filtering code will take the 240 // call through to the base impl so that the image filtering code will take the
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 } 1926 }
1927 1927
1928 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { 1928 SkImageFilterCache* SkGpuDevice::getImageFilterCache() {
1929 ASSERT_SINGLE_OWNER 1929 ASSERT_SINGLE_OWNER
1930 // We always return a transient cache, so it is freed after each 1930 // We always return a transient cache, so it is freed after each
1931 // filter traversal. 1931 // filter traversal.
1932 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); 1932 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize);
1933 } 1933 }
1934 1934
1935 #endif 1935 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698