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

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

Issue 1230803002: YUV to RGB Texture threading GrProcessorDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 5 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/GrPipelineBuilder.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.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 #include "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag; 421 rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag;
422 422
423 GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRe f, NULL, 0); 423 GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRe f, NULL, 0);
424 if (!result) { 424 if (!result) {
425 return NULL; 425 return NULL;
426 } 426 }
427 427
428 GrRenderTarget* renderTarget = result->asRenderTarget(); 428 GrRenderTarget* renderTarget = result->asRenderTarget();
429 SkASSERT(renderTarget); 429 SkASSERT(renderTarget);
430 430
431 GrPaint paint;
431 SkAutoTUnref<GrFragmentProcessor> 432 SkAutoTUnref<GrFragmentProcessor>
432 yuvToRgbProcessor(GrYUVtoRGBEffect::Create(yuvTextures[0], yuvTextures[1 ], yuvTextures[2], 433 yuvToRgbProcessor(GrYUVtoRGBEffect::Create(paint.getProcessorDataManager (), yuvTextures[0],
434 yuvTextures[1], yuvTextures[2 ],
433 yuvInfo.fSize, yuvInfo.fColor Space)); 435 yuvInfo.fSize, yuvInfo.fColor Space));
434 GrPaint paint;
435 paint.addColorProcessor(yuvToRgbProcessor); 436 paint.addColorProcessor(yuvToRgbProcessor);
436 SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth), 437 SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth),
437 SkIntToScalar(yuvInfo.fSize[0].fHeight)); 438 SkIntToScalar(yuvInfo.fSize[0].fHeight));
438 439
439 GrDrawContext* drawContext = ctx->drawContext(); 440 GrDrawContext* drawContext = ctx->drawContext();
440 if (!drawContext) { 441 if (!drawContext) {
441 return NULL; 442 return NULL;
442 } 443 }
443 444
444 drawContext->drawRect(renderTarget, GrClip::WideOpen(), paint, SkMatrix::I() , r); 445 drawContext->drawRect(renderTarget, GrClip::WideOpen(), paint, SkMatrix::I() , r);
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 801 }
801 return SkImageInfo::Make(w, h, ct, at); 802 return SkImageInfo::Make(w, h, ct, at);
802 } 803 }
803 804
804 805
805 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) { 806 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) {
806 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque); 807 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque);
807 dst->setInfo(info); 808 dst->setInfo(info);
808 dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref(); 809 dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref();
809 } 810 }
OLDNEW
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/effects/GrYUVtoRGBEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698