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

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

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: fix crash Created 4 years, 7 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/effects/SkLightingImageFilter.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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 471
472 static sk_sp<SkSpecialImage> apply_morphology(GrContext* context, 472 static sk_sp<SkSpecialImage> apply_morphology(GrContext* context,
473 SkSpecialImage* input, 473 SkSpecialImage* input,
474 const SkIRect& rect, 474 const SkIRect& rect,
475 GrMorphologyEffect::MorphologyType morphType, 475 GrMorphologyEffect::MorphologyType morphType,
476 SkISize radius) { 476 SkISize radius) {
477 sk_sp<GrTexture> srcTexture(input->asTextureRef(context)); 477 sk_sp<GrTexture> srcTexture(input->asTextureRef(context));
478 SkASSERT(srcTexture); 478 SkASSERT(srcTexture);
479 479
480 // setup new clip 480 // setup new clip
481 const GrClip clip(SkRect::MakeWH(SkIntToScalar(srcTexture->width()), 481 const GrFixedClip clip(SkIRect::MakeWH(srcTexture->width(), srcTexture->heig ht()));
482 SkIntToScalar(srcTexture->height())));
483 482
484 const SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height()); 483 const SkIRect dstRect = SkIRect::MakeWH(rect.width(), rect.height());
485 SkIRect srcRect = rect; 484 SkIRect srcRect = rect;
486 485
487 SkASSERT(radius.width() > 0 || radius.height() > 0); 486 SkASSERT(radius.width() > 0 || radius.height() > 0);
488 487
489 if (radius.fWidth > 0) { 488 if (radius.fWidth > 0) {
490 sk_sp<GrDrawContext> dstDrawContext(context->newDrawContext(SkBackingFit ::kApprox, 489 sk_sp<GrDrawContext> dstDrawContext(context->newDrawContext(SkBackingFit ::kApprox,
491 rect.width() , rect.height(), 490 rect.width() , rect.height(),
492 kSkia8888_Gr PixelConfig)); 491 kSkia8888_Gr PixelConfig));
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 inputBM.getAddr32(srcBounds.left(), srcBounds.top()), 627 inputBM.getAddr32(srcBounds.left(), srcBounds.top()),
629 inputBM.rowBytesAsPixels(), 628 inputBM.rowBytesAsPixels(),
630 &dst, height, srcBounds); 629 &dst, height, srcBounds);
631 } 630 }
632 offset->fX = bounds.left(); 631 offset->fX = bounds.left();
633 offset->fY = bounds.top(); 632 offset->fY = bounds.top();
634 633
635 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds .height()), 634 return SkSpecialImage::MakeFromRaster(SkIRect::MakeWH(bounds.width(), bounds .height()),
636 dst, &source->props()); 635 dst, &source->props());
637 } 636 }
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698