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

Side by Side Diff: src/effects/SkBicubicImageFilter.cpp

Issue 22209002: Added ctm matrix to GPU path (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Removed dummy matrix Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkImageFilterUtils.cpp ('k') | src/effects/SkBlurImageFilter.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 2013 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
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 "SkBicubicImageFilter.h" 8 #include "SkBicubicImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 GrTexture* textures[]) { 334 GrTexture* textures[]) {
335 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : 335 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
336 GrEffectUnitTest::kAlphaTextureIdx; 336 GrEffectUnitTest::kAlphaTextureIdx;
337 SkScalar coefficients[16]; 337 SkScalar coefficients[16];
338 for (int i = 0; i < 16; i++) { 338 for (int i = 0; i < 16; i++) {
339 coefficients[i] = random->nextSScalar1(); 339 coefficients[i] = random->nextSScalar1();
340 } 340 }
341 return GrBicubicEffect::Create(textures[texIdx], coefficients); 341 return GrBicubicEffect::Create(textures[texIdx], coefficients);
342 } 342 }
343 343
344 bool SkBicubicImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkB itmap* result, SkIPoint* offset) { 344 bool SkBicubicImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, con st SkMatrix& ctm,
345 SkBitmap* result, SkIPoint* offset) {
345 SkBitmap srcBM; 346 SkBitmap srcBM;
346 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &srcBM, offset)) { 347 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, ctm, &sr cBM, offset)) {
347 return false; 348 return false;
348 } 349 }
349 GrTexture* srcTexture = srcBM.getTexture(); 350 GrTexture* srcTexture = srcBM.getTexture();
350 GrContext* context = srcTexture->getContext(); 351 GrContext* context = srcTexture->getContext();
351 352
352 SkRect dstRect = SkRect::MakeWH(srcBM.width() * fScale.fWidth, 353 SkRect dstRect = SkRect::MakeWH(srcBM.width() * fScale.fWidth,
353 srcBM.height() * fScale.fHeight); 354 srcBM.height() * fScale.fHeight);
354 355
355 GrTextureDesc desc; 356 GrTextureDesc desc;
356 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; 357 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
(...skipping 10 matching lines...) Expand all
367 GrPaint paint; 368 GrPaint paint;
368 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un ref(); 369 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un ref();
369 SkRect srcRect; 370 SkRect srcRect;
370 srcBM.getBounds(&srcRect); 371 srcBM.getBounds(&srcRect);
371 context->drawRectToRect(paint, dstRect, srcRect); 372 context->drawRectToRect(paint, dstRect, srcRect);
372 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t); 373 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t);
373 } 374 }
374 #endif 375 #endif
375 376
376 /////////////////////////////////////////////////////////////////////////////// 377 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/core/SkImageFilterUtils.cpp ('k') | src/effects/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698