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

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

Issue 253833002: move common blur types into central header (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | tests/BlurTest.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkEmbossMaskFilter.h" 10 #include "SkEmbossMaskFilter.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 SkMask::Format SkEmbossMaskFilter::getFormat() const { 71 SkMask::Format SkEmbossMaskFilter::getFormat() const {
72 return SkMask::k3D_Format; 72 return SkMask::k3D_Format;
73 } 73 }
74 74
75 bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src, 75 bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src,
76 const SkMatrix& matrix, SkIPoint* margin) co nst { 76 const SkMatrix& matrix, SkIPoint* margin) co nst {
77 SkScalar sigma = matrix.mapRadius(fBlurSigma); 77 SkScalar sigma = matrix.mapRadius(fBlurSigma);
78 78
79 if (!SkBlurMask::BoxBlur(dst, src, sigma, SkBlurMask::kInner_Style, 79 if (!SkBlurMask::BoxBlur(dst, src, sigma, kInner_SkBlurStyle, kLow_SkBlurQua lity)) {
80 SkBlurMask::kLow_Quality)) {
81 return false; 80 return false;
82 } 81 }
83 82
84 dst->fFormat = SkMask::k3D_Format; 83 dst->fFormat = SkMask::k3D_Format;
85 if (margin) { 84 if (margin) {
86 margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma)); 85 margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma));
87 } 86 }
88 87
89 if (src.fImage == NULL) { 88 if (src.fImage == NULL) {
90 return true; 89 return true;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 str->append(") "); 152 str->append(") ");
154 153
155 str->appendf("ambient: %d specular: %d ", 154 str->appendf("ambient: %d specular: %d ",
156 fLight.fAmbient, fLight.fSpecular); 155 fLight.fAmbient, fLight.fSpecular);
157 156
158 str->append("blurSigma: "); 157 str->append("blurSigma: ");
159 str->appendScalar(fBlurSigma); 158 str->appendScalar(fBlurSigma);
160 str->append(")"); 159 str->append(")");
161 } 160 }
162 #endif 161 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | tests/BlurTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698