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

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

Issue 789163006: Add toString methods to SkImageFilter-derived classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make sure leading 0's aren't stripped off colors Created 6 years 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/core/SkPaint.cpp ('k') | src/effects/SkBitmapSource.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
11 #include "SkWriteBuffer.h" 11 #include "SkWriteBuffer.h"
12 #include "SkRegion.h" 12 #include "SkRegion.h"
13 13
14 class SK_API SkAlphaThresholdFilterImpl : public SkImageFilter { 14 class SK_API SkAlphaThresholdFilterImpl : public SkImageFilter {
15 public: 15 public:
16 SkAlphaThresholdFilterImpl(const SkRegion& region, SkScalar innerThreshold, 16 SkAlphaThresholdFilterImpl(const SkRegion& region, SkScalar innerThreshold,
17 SkScalar outerThreshold, SkImageFilter* input); 17 SkScalar outerThreshold, SkImageFilter* input);
18 18
19 SK_TO_STRING_OVERRIDE()
19 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAlphaThresholdFilterIm pl) 20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAlphaThresholdFilterIm pl)
20 21
21 protected: 22 protected:
22 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 23 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
23 24
24 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
25 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE; 26 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE;
26 #if SK_SUPPORT_GPU 27 #if SK_SUPPORT_GPU
27 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk Matrix&, 28 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk Matrix&,
28 const SkIRect& bounds) const SK_OVERRIDE; 29 const SkIRect& bounds) const SK_OVERRIDE;
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 (U8CPU)(SkColorGetG(source) * scale), 368 (U8CPU)(SkColorGetG(source) * scale),
368 (U8CPU)(SkColorGetB(source) * scale)); 369 (U8CPU)(SkColorGetB(source) * scale));
369 } 370 }
370 } 371 }
371 dptr[y * dst->width() + x] = output_color; 372 dptr[y * dst->width() + x] = output_color;
372 } 373 }
373 } 374 }
374 375
375 return true; 376 return true;
376 } 377 }
378
379 #ifndef SK_IGNORE_TO_STRING
380 void SkAlphaThresholdFilterImpl::toString(SkString* str) const {
381 str->appendf("SkAlphaThresholdImageFilter: (");
382 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold);
383 str->append(")");
384 }
385 #endif
386
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/effects/SkBitmapSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698