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

Side by Side Diff: src/image/SkImage_Gpu.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 | « src/image/SkImage.cpp ('k') | no next file » | 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 "SkAutoPixmapStorage.h" 8 #include "SkAutoPixmapStorage.h"
9 #include "GrCaps.h" 9 #include "GrCaps.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 return nullptr; 461 return nullptr;
462 } 462 }
463 463
464 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); 464 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight);
465 const SkIPoint dstP = SkIPoint::Make(0, 0); 465 const SkIPoint dstP = SkIPoint::Make(0, 0);
466 ctx->copySurface(dst, src, srcR, dstP); 466 ctx->copySurface(dst, src, srcR, dstP);
467 ctx->flushSurfaceWrites(dst); 467 ctx->flushSurfaceWrites(dst);
468 return dst; 468 return dst;
469 } 469 }
470 470
471 sk_sp<SkImage> SkImage::MakeTextureFromMipMap(GrContext* ctx, const SkImageInfo& info,
472 const GrMipLevel* texels, int mipL evelCount,
473 SkBudgeted budgeted) {
474 if (!ctx) {
475 return nullptr;
476 }
477 SkAutoTUnref<GrTexture> texture(GrUploadMipMapToTexture(ctx, info, texels, m ipLevelCount));
478 if (!texture) {
479 return nullptr;
480 }
481 return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNew ImageUniqueID,
482 info.alphaType(), texture, budgeted);
483 }
OLDNEW
« no previous file with comments | « src/image/SkImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698