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

Side by Side Diff: src/image/SkImage_Gpu.cpp

Issue 1809663002: Propogate SkBudgeted for NewFromDeferredTextureImageData (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: 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') | 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 "GrCaps.h" 8 #include "GrCaps.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 GrBitmapTextureMaker maker(context, bmp); 311 GrBitmapTextureMaker maker(context, bmp);
312 return create_image_from_maker(&maker, at, this->uniqueID()); 312 return create_image_from_maker(&maker, at, this->uniqueID());
313 } 313 }
314 314
315 sk_sp<SkImage> SkImage::MakeTextureFromPixmap(GrContext* ctx, const SkPixmap& pi xmap, 315 sk_sp<SkImage> SkImage::MakeTextureFromPixmap(GrContext* ctx, const SkPixmap& pi xmap,
316 SkBudgeted budgeted) { 316 SkBudgeted budgeted) {
317 if (!ctx) { 317 if (!ctx) {
318 return nullptr; 318 return nullptr;
319 } 319 }
320 SkAutoTUnref<GrTexture> texture(GrUploadPixmapToTexture(ctx, pixmap)); 320 SkAutoTUnref<GrTexture> texture(GrUploadPixmapToTexture(ctx, pixmap, budgete d));
321 if (!texture) { 321 if (!texture) {
322 return nullptr; 322 return nullptr;
323 } 323 }
324 return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNew ImageUniqueID, 324 return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNew ImageUniqueID,
325 pixmap.alphaType(), texture, budgeted); 325 pixmap.alphaType(), texture, budgeted);
326 } 326 }
327 327
328 //////////////////////////////////////////////////////////////////////////////// /////////////////// 328 //////////////////////////////////////////////////////////////////////////////// ///////////////////
329 329
330 class DeferredTextureImage { 330 class DeferredTextureImage {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 return nullptr; 449 return nullptr;
450 } 450 }
451 451
452 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); 452 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight);
453 const SkIPoint dstP = SkIPoint::Make(0, 0); 453 const SkIPoint dstP = SkIPoint::Make(0, 0);
454 ctx->copySurface(dst, src, srcR, dstP); 454 ctx->copySurface(dst, src, srcR, dstP);
455 ctx->flushSurfaceWrites(dst); 455 ctx->flushSurfaceWrites(dst);
456 return dst; 456 return dst;
457 } 457 }
458 458
OLDNEW
« no previous file with comments | « src/gpu/SkGrPriv.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698