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

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: Refactoring the mipmap level count out. Cleaning includes. Created 4 years, 11 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
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 color[1] = SkTMin(x, y); 172 color[1] = SkTMin(x, y);
173 color[0] = SkTMin(x, y); 173 color[0] = SkTMin(x, y);
174 } 174 }
175 } 175 }
176 176
177 GrSurfaceDesc desc; 177 GrSurfaceDesc desc;
178 desc.fFlags = kRenderTarget_GrSurfaceFlag; 178 desc.fFlags = kRenderTarget_GrSurfaceFlag;
179 desc.fWidth = 256; 179 desc.fWidth = 256;
180 desc.fHeight = 256; 180 desc.fHeight = 256;
181 desc.fConfig = kRGBA_8888_GrPixelConfig; 181 desc.fConfig = kRGBA_8888_GrPixelConfig;
182 desc.fIsMipMapped = false;
182 183
183 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0)); 184 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0));
184 if (!readTex.get()) { 185 if (!readTex.get()) {
185 return; 186 return;
186 } 187 }
187 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0)); 188 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0));
188 if (!tempTex.get()) { 189 if (!tempTex.get()) {
189 return; 190 return;
190 } 191 }
191 desc.fFlags = kNone_GrSurfaceFlags; 192 desc.fFlags = kNone_GrSurfaceFlags;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } else { 301 } else {
301 if (kRGBA_8888_GrPixelConfig != texture->config() && 302 if (kRGBA_8888_GrPixelConfig != texture->config() &&
302 kBGRA_8888_GrPixelConfig != texture->config() && 303 kBGRA_8888_GrPixelConfig != texture->config() &&
303 kNone_PMConversion != pmConversion) { 304 kNone_PMConversion != pmConversion) {
304 // The PM conversions assume colors are 0..255 305 // The PM conversions assume colors are 0..255
305 return nullptr; 306 return nullptr;
306 } 307 }
307 return new GrConfigConversionEffect(texture, swapRedAndBlue, pmConversio n, matrix); 308 return new GrConfigConversionEffect(texture, swapRedAndBlue, pmConversio n, matrix);
308 } 309 }
309 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698