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

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

Issue 462013002: remove SkStippleMaskFilter - no external clients (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « include/effects/SkStippleMaskFilter.h ('k') | src/ports/SkGlobalInitialization_chromium.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkStippleMaskFilter.h"
9 #include "SkString.h"
10
11 bool SkStippleMaskFilter::filterMask(SkMask* dst,
12 const SkMask& src,
13 const SkMatrix& matrix,
14 SkIPoint* margin) const {
15
16 if (src.fFormat != SkMask::kA8_Format) {
17 return false;
18 }
19
20 dst->fBounds = src.fBounds;
21 dst->fRowBytes = dst->fBounds.width();
22 dst->fFormat = SkMask::kA8_Format;
23 dst->fImage = NULL;
24
25 if (NULL != src.fImage) {
26 size_t dstSize = dst->computeImageSize();
27 if (0 == dstSize) {
28 return false; // too big to allocate, abort
29 }
30
31 dst->fImage = SkMask::AllocImage(dstSize);
32
33 uint8_t* srcScanLine = src.fImage;
34 uint8_t* scanline = dst->fImage;
35
36 for (int y = 0; y < src.fBounds.height(); ++y) {
37 for (int x = 0; x < src.fBounds.width(); ++x) {
38 scanline[x] = srcScanLine[x] && ((x+y) & 0x1) ? 0xFF : 0x00;
39 }
40 scanline += dst->fRowBytes;
41 srcScanLine += src.fRowBytes;
42 }
43 }
44
45 return true;
46 }
47
48 #ifndef SK_IGNORE_TO_STRING
49 void SkStippleMaskFilter::toString(SkString* str) const {
50 str->append("SkStippleMaskFilter: ()");
51 }
52 #endif
OLDNEW
« no previous file with comments | « include/effects/SkStippleMaskFilter.h ('k') | src/ports/SkGlobalInitialization_chromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698