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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 2031273002: Plumbing mipmaps to the point of creation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: MakeTextureFromMipMap is now private. 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 | « include/core/SkImage.h ('k') | src/gpu/SkGrPriv.h » ('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 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 #include "SkGrPriv.h" 10 #include "SkGrPriv.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 SkMipMap::Level generatedMipLevel; 387 SkMipMap::Level generatedMipLevel;
388 mipmaps->getLevel(i - 1, &generatedMipLevel); 388 mipmaps->getLevel(i - 1, &generatedMipLevel);
389 texels[i].fPixels = generatedMipLevel.fPixmap.addr(); 389 texels[i].fPixels = generatedMipLevel.fPixmap.addr();
390 texels[i].fRowBytes = generatedMipLevel.fPixmap.rowBytes(); 390 texels[i].fRowBytes = generatedMipLevel.fPixmap.rowBytes();
391 } 391 }
392 392
393 return ctx->textureProvider()->createMipMappedTexture(desc, SkBudgeted::kYes , texels.get(), 393 return ctx->textureProvider()->createMipMappedTexture(desc, SkBudgeted::kYes , texels.get(),
394 mipLevelCount); 394 mipLevelCount);
395 } 395 }
396 396
397 GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
398 const GrMipLevel* texels, int mipLevelCount) {
399 const GrCaps* caps = ctx->caps();
400 return ctx->textureProvider()->createMipMappedTexture(GrImageInfoToSurfaceDe sc(info, *caps),
401 SkBudgeted::kYes, texe ls,
402 mipLevelCount);
403 }
404
397 GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap, 405 GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
398 const GrTextureParams& params) { 406 const GrTextureParams& params) {
399 if (bitmap.getTexture()) { 407 if (bitmap.getTexture()) {
400 return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, nullptr); 408 return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, nullptr);
401 } 409 }
402 return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params); 410 return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params);
403 } 411 }
404 412
405 /////////////////////////////////////////////////////////////////////////////// 413 ///////////////////////////////////////////////////////////////////////////////
406 414
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 SkErrorInternals::SetError( kInvalidPaint_SkError, 767 SkErrorInternals::SetError( kInvalidPaint_SkError,
760 "Sorry, I don't understand the filtering " 768 "Sorry, I don't understand the filtering "
761 "mode you asked for. Falling back to " 769 "mode you asked for. Falling back to "
762 "MIPMaps."); 770 "MIPMaps.");
763 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 771 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
764 break; 772 break;
765 773
766 } 774 }
767 return textureFilterMode; 775 return textureFilterMode;
768 } 776 }
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/gpu/SkGrPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698