OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 "SkPaintPart.h" | 8 #include "SkPaintPart.h" |
9 #include "SkDrawPaint.h" | 9 #include "SkDrawPaint.h" |
10 #ifdef SK_DUMP_ENABLED | 10 #ifdef SK_DUMP_ENABLED |
11 #include "SkDisplayList.h" | 11 #include "SkDisplayList.h" |
12 #include "SkDump.h" | 12 #include "SkDump.h" |
13 #endif | 13 #endif |
14 | 14 |
15 SkPaintPart::SkPaintPart() : fPaint(NULL) { | 15 SkPaintPart::SkPaintPart() : fPaint(nullptr) { |
16 } | 16 } |
17 | 17 |
18 SkDisplayable* SkPaintPart::getParent() const { | 18 SkDisplayable* SkPaintPart::getParent() const { |
19 return fPaint; | 19 return fPaint; |
20 } | 20 } |
21 | 21 |
22 bool SkPaintPart::setParent(SkDisplayable* parent) { | 22 bool SkPaintPart::setParent(SkDisplayable* parent) { |
23 SkASSERT(parent != NULL); | 23 SkASSERT(parent != nullptr); |
24 if (parent->isPaint() == false) | 24 if (parent->isPaint() == false) |
25 return true; | 25 return true; |
26 fPaint = (SkDrawPaint*) parent; | 26 fPaint = (SkDrawPaint*) parent; |
27 return false; | 27 return false; |
28 } | 28 } |
29 | 29 |
30 | 30 |
31 // SkDrawMaskFilter | 31 // SkDrawMaskFilter |
32 bool SkDrawMaskFilter::add() { | 32 bool SkDrawMaskFilter::add() { |
33 if (fPaint->maskFilter != (SkDrawMaskFilter*) -1) | 33 if (fPaint->maskFilter != (SkDrawMaskFilter*) -1) |
34 return true; | 34 return true; |
35 fPaint->maskFilter = this; | 35 fPaint->maskFilter = this; |
36 fPaint->fOwnsMaskFilter = true; | 36 fPaint->fOwnsMaskFilter = true; |
37 return false; | 37 return false; |
38 } | 38 } |
39 | 39 |
40 SkMaskFilter* SkDrawMaskFilter::getMaskFilter() { | 40 SkMaskFilter* SkDrawMaskFilter::getMaskFilter() { |
41 return NULL; | 41 return nullptr; |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 // SkDrawPathEffect | 45 // SkDrawPathEffect |
46 bool SkDrawPathEffect::add() { | 46 bool SkDrawPathEffect::add() { |
47 if (fPaint->isPaint()) { | 47 if (fPaint->isPaint()) { |
48 if (fPaint->pathEffect != (SkDrawPathEffect*) -1) | 48 if (fPaint->pathEffect != (SkDrawPathEffect*) -1) |
49 return true; | 49 return true; |
50 fPaint->pathEffect = this; | 50 fPaint->pathEffect = this; |
51 fPaint->fOwnsPathEffect = true; | 51 fPaint->fOwnsPathEffect = true; |
52 return false; | 52 return false; |
53 } | 53 } |
54 fPaint->add(NULL, this); | 54 fPaint->add(nullptr, this); |
55 return false; | 55 return false; |
56 } | 56 } |
57 | 57 |
58 SkPathEffect* SkDrawPathEffect::getPathEffect() { | 58 SkPathEffect* SkDrawPathEffect::getPathEffect() { |
59 return NULL; | 59 return nullptr; |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 // SkDrawShader | 63 // SkDrawShader |
64 SkShader* SkDrawShader::getShader() { | 64 SkShader* SkDrawShader::getShader() { |
65 return NULL; | 65 return nullptr; |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 // Typeface | 69 // Typeface |
70 #if SK_USE_CONDENSED_INFO == 0 | 70 #if SK_USE_CONDENSED_INFO == 0 |
71 | 71 |
72 const SkMemberInfo SkDrawTypeface::fInfo[] = { | 72 const SkMemberInfo SkDrawTypeface::fInfo[] = { |
73 SK_MEMBER(fontName, String), | 73 SK_MEMBER(fontName, String), |
74 SK_MEMBER(style, FontStyle) | 74 SK_MEMBER(style, FontStyle) |
75 }; | 75 }; |
(...skipping 14 matching lines...) Expand all Loading... |
90 } | 90 } |
91 | 91 |
92 #ifdef SK_DUMP_ENABLED | 92 #ifdef SK_DUMP_ENABLED |
93 void SkDrawTypeface::dump(SkAnimateMaker*) { | 93 void SkDrawTypeface::dump(SkAnimateMaker*) { |
94 SkDebugf("%*s<typeface fontName=\"%s\" ", SkDisplayList::fIndent, "", fontNa
me.c_str()); | 94 SkDebugf("%*s<typeface fontName=\"%s\" ", SkDisplayList::fIndent, "", fontNa
me.c_str()); |
95 SkString string; | 95 SkString string; |
96 SkDump::GetEnumString(SkType_FontStyle, style, &string); | 96 SkDump::GetEnumString(SkType_FontStyle, style, &string); |
97 SkDebugf("style=\"%s\" />\n", string.c_str()); | 97 SkDebugf("style=\"%s\" />\n", string.c_str()); |
98 } | 98 } |
99 #endif | 99 #endif |
OLD | NEW |