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

Side by Side Diff: src/gpu/effects/GrConfigConversionEffect.cpp

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment 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 | « src/gpu/SkGpuDevice.cpp ('k') | src/image/SkImage_Gpu.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 2012 Google Inc. 2 * Copyright 2012 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 "GrConfigConversionEffect.h" 8 #include "GrConfigConversionEffect.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 for (int x = 0; x < kSize; ++x) { 167 for (int x = 0; x < kSize; ++x) {
168 uint8_t* color = reinterpret_cast<uint8_t*>(&srcData[kSize*y + x]); 168 uint8_t* color = reinterpret_cast<uint8_t*>(&srcData[kSize*y + x]);
169 color[3] = y; 169 color[3] = y;
170 color[2] = SkTMin(x, y); 170 color[2] = SkTMin(x, y);
171 color[1] = SkTMin(x, y); 171 color[1] = SkTMin(x, y);
172 color[0] = SkTMin(x, y); 172 color[0] = SkTMin(x, y);
173 } 173 }
174 } 174 }
175 175
176 sk_sp<GrDrawContext> readDC(context->newDrawContext(SkBackingFit::kExact, kS ize, kSize, 176 sk_sp<GrDrawContext> readDC(context->newDrawContext(SkBackingFit::kExact, kS ize, kSize,
177 kConfig)); 177 kConfig, nullptr));
178 sk_sp<GrDrawContext> tempDC(context->newDrawContext(SkBackingFit::kExact, kS ize, kSize, 178 sk_sp<GrDrawContext> tempDC(context->newDrawContext(SkBackingFit::kExact, kS ize, kSize,
179 kConfig)); 179 kConfig, nullptr));
180 if (!readDC || !tempDC) { 180 if (!readDC || !tempDC) {
181 return; 181 return;
182 } 182 }
183 GrSurfaceDesc desc; 183 GrSurfaceDesc desc;
184 desc.fWidth = kSize; 184 desc.fWidth = kSize;
185 desc.fHeight = kSize; 185 desc.fHeight = kSize;
186 desc.fConfig = kConfig; 186 desc.fConfig = kConfig;
187 SkAutoTUnref<GrTexture> dataTex(context->textureProvider()->createTexture( 187 SkAutoTUnref<GrTexture> dataTex(context->textureProvider()->createTexture(
188 desc, SkBudgeted::kYes, data, 0)); 188 desc, SkBudgeted::kYes, data, 0));
189 if (!dataTex.get()) { 189 if (!dataTex.get()) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 if (kRGBA_8888_GrPixelConfig != texture->config() && 265 if (kRGBA_8888_GrPixelConfig != texture->config() &&
266 kBGRA_8888_GrPixelConfig != texture->config() && 266 kBGRA_8888_GrPixelConfig != texture->config() &&
267 kNone_PMConversion != pmConversion) { 267 kNone_PMConversion != pmConversion) {
268 // The PM conversions assume colors are 0..255 268 // The PM conversions assume colors are 0..255
269 return nullptr; 269 return nullptr;
270 } 270 }
271 return sk_sp<GrFragmentProcessor>( 271 return sk_sp<GrFragmentProcessor>(
272 new GrConfigConversionEffect(texture, swizzle, pmConversion, matrix) ); 272 new GrConfigConversionEffect(texture, swizzle, pmConversion, matrix) );
273 } 273 }
274 } 274 }
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698