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

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

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Rebasing. Created 4 years, 9 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/SkGrPriv.h ('k') | src/gpu/effects/GrTextureStripAtlas.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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 color[1] = SkTMin(x, y); 168 color[1] = SkTMin(x, y);
169 color[0] = SkTMin(x, y); 169 color[0] = SkTMin(x, y);
170 } 170 }
171 } 171 }
172 172
173 GrSurfaceDesc desc; 173 GrSurfaceDesc desc;
174 desc.fFlags = kRenderTarget_GrSurfaceFlag; 174 desc.fFlags = kRenderTarget_GrSurfaceFlag;
175 desc.fWidth = 256; 175 desc.fWidth = 256;
176 desc.fHeight = 256; 176 desc.fHeight = 256;
177 desc.fConfig = kRGBA_8888_GrPixelConfig; 177 desc.fConfig = kRGBA_8888_GrPixelConfig;
178 desc.fIsMipMapped = false;
178 179
179 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture( 180 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(
180 desc, SkBudgeted::kYes, nullptr, 0)); 181 desc, SkBudgeted::kYes, nullptr, 0));
181 if (!readTex.get()) { 182 if (!readTex.get()) {
182 return; 183 return;
183 } 184 }
184 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture( 185 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(
185 desc, SkBudgeted::kYes, nullptr, 0)); 186 desc, SkBudgeted::kYes, nullptr, 0));
186 if (!tempTex.get()) { 187 if (!tempTex.get()) {
187 return; 188 return;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } else { 300 } else {
300 if (kRGBA_8888_GrPixelConfig != texture->config() && 301 if (kRGBA_8888_GrPixelConfig != texture->config() &&
301 kBGRA_8888_GrPixelConfig != texture->config() && 302 kBGRA_8888_GrPixelConfig != texture->config() &&
302 kNone_PMConversion != pmConversion) { 303 kNone_PMConversion != pmConversion) {
303 // The PM conversions assume colors are 0..255 304 // The PM conversions assume colors are 0..255
304 return nullptr; 305 return nullptr;
305 } 306 }
306 return new GrConfigConversionEffect(texture, swizzle, pmConversion, matr ix); 307 return new GrConfigConversionEffect(texture, swizzle, pmConversion, matr ix);
307 } 308 }
308 } 309 }
OLDNEW
« no previous file with comments | « src/gpu/SkGrPriv.h ('k') | src/gpu/effects/GrTextureStripAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698