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

Side by Side Diff: src/effects/SkMorphologyImageFilter.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/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkXfermodeImageFilter.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 The Android Open Source Project 2 * Copyright 2012 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 "SkMorphologyImageFilter.h" 8 #include "SkMorphologyImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 apply_morphology_pass(context, srcTexture, rect, radius.fHeight, 495 apply_morphology_pass(context, srcTexture, rect, radius.fHeight,
496 morphType, Gr1DKernelEffect::kY_Direction); 496 morphType, Gr1DKernelEffect::kY_Direction);
497 srcTexture->unref(); 497 srcTexture->unref();
498 srcTexture = ast.detach(); 498 srcTexture = ast.detach();
499 } 499 }
500 return srcTexture; 500 return srcTexture;
501 } 501 }
502 502
503 }; 503 };
504 504
505 bool SkDilateImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBi tmap* result, 505 bool SkDilateImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, cons t SkMatrix& ctm,
506 SkIPoint* offset) { 506 SkBitmap* result, SkIPoint* offset) {
507 SkBitmap inputBM; 507 SkBitmap inputBM;
508 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &inputBM , offset)) { 508 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, ctm, &in putBM, offset)) {
509 return false; 509 return false;
510 } 510 }
511 GrTexture* input = inputBM.getTexture(); 511 GrTexture* input = inputBM.getTexture();
512 SkIRect bounds; 512 SkIRect bounds;
513 src.getBounds(&bounds); 513 src.getBounds(&bounds);
514 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds, 514 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds,
515 GrMorphologyEffect::kDilate_MorphologyType, radius())); 515 GrMorphologyEffect::kDilate_MorphologyType, radius()));
516 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result); 516 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result);
517 } 517 }
518 518
519 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBit map* result, 519 bool SkErodeImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
520 SkIPoint* offset) { 520 SkBitmap* result, SkIPoint* offset) {
521 SkBitmap inputBM; 521 SkBitmap inputBM;
522 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &inputBM , offset)) { 522 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, ctm, &in putBM, offset)) {
523 return false; 523 return false;
524 } 524 }
525 GrTexture* input = inputBM.getTexture(); 525 GrTexture* input = inputBM.getTexture();
526 SkIRect bounds; 526 SkIRect bounds;
527 src.getBounds(&bounds); 527 src.getBounds(&bounds);
528 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds, 528 SkAutoTUnref<GrTexture> resultTex(apply_morphology(input, bounds,
529 GrMorphologyEffect::kErode_MorphologyType, radius())); 529 GrMorphologyEffect::kErode_MorphologyType, radius()));
530 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result); 530 return SkImageFilterUtils::WrapTexture(resultTex, src.width(), src.height(), result);
531 } 531 }
532 532
533 #endif 533 #endif
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698