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

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

Issue 26371002: Change SkImageFilter's cropRect from SkIRect to a CropRect struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Alternate version, using a single fFlags member. Created 7 years, 2 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/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.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"
11 #include "SkFlattenableBuffers.h" 11 #include "SkFlattenableBuffers.h"
12 #include "SkRect.h" 12 #include "SkRect.h"
13 #if SK_SUPPORT_GPU 13 #if SK_SUPPORT_GPU
14 #include "GrContext.h" 14 #include "GrContext.h"
15 #include "GrTexture.h" 15 #include "GrTexture.h"
16 #include "GrTBackendEffectFactory.h" 16 #include "GrTBackendEffectFactory.h"
17 #include "gl/GrGLEffect.h" 17 #include "gl/GrGLEffect.h"
18 #include "effects/Gr1DKernelEffect.h" 18 #include "effects/Gr1DKernelEffect.h"
19 #include "SkImageFilterUtils.h" 19 #include "SkImageFilterUtils.h"
20 #endif 20 #endif
21 21
22 SkMorphologyImageFilter::SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer ) 22 SkMorphologyImageFilter::SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer )
23 : INHERITED(buffer) { 23 : INHERITED(buffer) {
24 fRadius.fWidth = buffer.readInt(); 24 fRadius.fWidth = buffer.readInt();
25 fRadius.fHeight = buffer.readInt(); 25 fRadius.fHeight = buffer.readInt();
26 } 26 }
27 27
28 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, int radiusY, SkIma geFilter* input, const SkIRect* cropRect) 28 SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, int radiusY, SkIma geFilter* input, const CropRect* cropRect)
29 : INHERITED(input, cropRect), fRadius(SkISize::Make(radiusX, radiusY)) { 29 : INHERITED(input, cropRect), fRadius(SkISize::Make(radiusX, radiusY)) {
30 } 30 }
31 31
32 32
33 void SkMorphologyImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const { 33 void SkMorphologyImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
34 this->INHERITED::flatten(buffer); 34 this->INHERITED::flatten(buffer);
35 buffer.writeInt(fRadius.fWidth); 35 buffer.writeInt(fRadius.fWidth);
36 buffer.writeInt(fRadius.fHeight); 36 buffer.writeInt(fRadius.fHeight);
37 } 37 }
38 38
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 if (!apply_morphology(input, bounds, GrMorphologyEffect::kErode_MorphologyTy pe, radius(), result)) { 582 if (!apply_morphology(input, bounds, GrMorphologyEffect::kErode_MorphologyTy pe, radius(), result)) {
583 return false; 583 return false;
584 } 584 }
585 offset->fX += bounds.left(); 585 offset->fX += bounds.left();
586 offset->fY += bounds.top(); 586 offset->fY += bounds.top();
587 return true; 587 return true;
588 } 588 }
589 589
590 #endif 590 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698