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

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

Issue 253633003: add asAShadowBlur for android to drawlooper (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add unittests (and fix bugs in layerdrawlooper) 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') | src/effects/SkLayerDrawLooper.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
2 /* 1 /*
3 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9
10 #include "SkEmbossMaskFilter.h" 8 #include "SkEmbossMaskFilter.h"
11 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
12 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
13 #include "SkEmbossMask.h" 11 #include "SkEmbossMask.h"
14 #include "SkReadBuffer.h" 12 #include "SkReadBuffer.h"
15 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
16 #include "SkString.h" 14 #include "SkString.h"
17 15
16 SkEmbossMaskFilter* SkEmbossMaskFilter::Create(SkScalar blurSigma, const Light& light) {
17 return SkNEW_ARGS(SkEmbossMaskFilter, (blurSigma, light));
18 }
19
18 static inline int pin2byte(int n) { 20 static inline int pin2byte(int n) {
19 if (n < 0) { 21 if (n < 0) {
20 n = 0; 22 n = 0;
21 } else if (n > 0xFF) { 23 } else if (n > 0xFF) {
22 n = 0xFF; 24 n = 0xFF;
23 } 25 }
24 return n; 26 return n;
25 } 27 }
26 28
27 SkMaskFilter* SkBlurMaskFilter::CreateEmboss(const SkScalar direction[3], 29 SkMaskFilter* SkBlurMaskFilter::CreateEmboss(const SkScalar direction[3],
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 str->append(") "); 154 str->append(") ");
153 155
154 str->appendf("ambient: %d specular: %d ", 156 str->appendf("ambient: %d specular: %d ",
155 fLight.fAmbient, fLight.fSpecular); 157 fLight.fAmbient, fLight.fSpecular);
156 158
157 str->append("blurSigma: "); 159 str->append("blurSigma: ");
158 str->appendScalar(fBlurSigma); 160 str->appendScalar(fBlurSigma);
159 str->append(")"); 161 str->append(")");
160 } 162 }
161 #endif 163 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkLayerDrawLooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698