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

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

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. 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/SkImageShader.cpp ('k') | tests/GLProgramsTest.cpp » ('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 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 width, height, 259 width, height,
260 kRGBA_8888_GrPixelConfi g, 260 kRGBA_8888_GrPixelConfi g,
261 0, 261 0,
262 origin)); 262 origin));
263 if (!drawContext) { 263 if (!drawContext) {
264 return nullptr; 264 return nullptr;
265 } 265 }
266 266
267 GrPaint paint; 267 GrPaint paint;
268 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 268 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
269 paint.addColorFragmentProcessor(GrYUVEffect::CreateYUVToRGB(yTex, uTex, vTex , yuvSizes, 269 paint.addColorFragmentProcessor(GrYUVEffect::MakeYUVToRGB(yTex, uTex, vTex, yuvSizes,
270 colorSpace))->un ref(); 270 colorSpace));
271 271
272 const SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(heigh t)); 272 const SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(heigh t));
273 273
274 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), rect); 274 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), rect);
275 ctx->flushSurfaceWrites(drawContext->accessRenderTarget()); 275 ctx->flushSurfaceWrites(drawContext->accessRenderTarget());
276 return sk_make_sp<SkImage_Gpu>(width, height, kNeedNewImageUniqueID, 276 return sk_make_sp<SkImage_Gpu>(width, height, kNeedNewImageUniqueID,
277 kOpaque_SkAlphaType, 277 kOpaque_SkAlphaType,
278 drawContext->asTexture().get(), budgeted); 278 drawContext->asTexture().get(), budgeted);
279 } 279 }
280 280
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 if (!ctx) { 477 if (!ctx) {
478 return nullptr; 478 return nullptr;
479 } 479 }
480 SkAutoTUnref<GrTexture> texture(GrUploadMipMapToTexture(ctx, info, texels, m ipLevelCount)); 480 SkAutoTUnref<GrTexture> texture(GrUploadMipMapToTexture(ctx, info, texels, m ipLevelCount));
481 if (!texture) { 481 if (!texture) {
482 return nullptr; 482 return nullptr;
483 } 483 }
484 return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNew ImageUniqueID, 484 return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNew ImageUniqueID,
485 info.alphaType(), texture, budgeted); 485 info.alphaType(), texture, budgeted);
486 } 486 }
OLDNEW
« no previous file with comments | « src/image/SkImageShader.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698