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

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: Fixing incorrect rebase. Created 5 years, 2 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 color[1] = SkTMin(x, y); 174 color[1] = SkTMin(x, y);
175 color[0] = SkTMin(x, y); 175 color[0] = SkTMin(x, y);
176 } 176 }
177 } 177 }
178 178
179 GrSurfaceDesc desc; 179 GrSurfaceDesc desc;
180 desc.fFlags = kRenderTarget_GrSurfaceFlag; 180 desc.fFlags = kRenderTarget_GrSurfaceFlag;
181 desc.fWidth = 256; 181 desc.fWidth = 256;
182 desc.fHeight = 256; 182 desc.fHeight = 256;
183 desc.fConfig = kRGBA_8888_GrPixelConfig; 183 desc.fConfig = kRGBA_8888_GrPixelConfig;
184 desc.fIsMipMapped = false;
184 185
185 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0)); 186 SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0));
186 if (!readTex.get()) { 187 if (!readTex.get()) {
187 return; 188 return;
188 } 189 }
189 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0)); 190 SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(de sc, true, nullptr, 0));
190 if (!tempTex.get()) { 191 if (!tempTex.get()) {
191 return; 192 return;
192 } 193 }
193 desc.fFlags = kNone_GrSurfaceFlags; 194 desc.fFlags = kNone_GrSurfaceFlags;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 if (kRGBA_8888_GrPixelConfig != texture->config() && 303 if (kRGBA_8888_GrPixelConfig != texture->config() &&
303 kBGRA_8888_GrPixelConfig != texture->config() && 304 kBGRA_8888_GrPixelConfig != texture->config() &&
304 kNone_PMConversion != pmConversion) { 305 kNone_PMConversion != pmConversion) {
305 // The PM conversions assume colors are 0..255 306 // The PM conversions assume colors are 0..255
306 return nullptr; 307 return nullptr;
307 } 308 }
308 return new GrConfigConversionEffect(procDataManager, texture, swapRedAnd Blue, pmConversion, 309 return new GrConfigConversionEffect(procDataManager, texture, swapRedAnd Blue, pmConversion,
309 matrix); 310 matrix);
310 } 311 }
311 } 312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698