| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 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 #include "SkViewPriv.h" | 8 #include "SkViewPriv.h" |
| 9 | 9 |
| 10 ////////////////////////////////////////////////////////////////////// | 10 ////////////////////////////////////////////////////////////////////// |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 void SkView::Artist::onInflate(const SkDOM&, const SkDOM::Node*) | 24 void SkView::Artist::onInflate(const SkDOM&, const SkDOM::Node*) |
| 25 { | 25 { |
| 26 // subclass should override this as needed | 26 // subclass should override this as needed |
| 27 } | 27 } |
| 28 | 28 |
| 29 SkView::Artist* SkView::getArtist() const | 29 SkView::Artist* SkView::getArtist() const |
| 30 { | 30 { |
| 31 Artist_SkTagList* rec = (Artist_SkTagList*)this->findTagList(kViewArtist_SkT
agList); | 31 Artist_SkTagList* rec = (Artist_SkTagList*)this->findTagList(kViewArtist_SkT
agList); |
| 32 SkASSERT(rec == NULL || rec->fArtist != NULL); | 32 SkASSERT(rec == nullptr || rec->fArtist != nullptr); |
| 33 | 33 |
| 34 return rec ? rec->fArtist : NULL; | 34 return rec ? rec->fArtist : nullptr; |
| 35 } | 35 } |
| 36 | 36 |
| 37 SkView::Artist* SkView::setArtist(Artist* obj) | 37 SkView::Artist* SkView::setArtist(Artist* obj) |
| 38 { | 38 { |
| 39 if (obj == NULL) | 39 if (obj == nullptr) |
| 40 { | 40 { |
| 41 this->removeTagList(kViewArtist_SkTagList); | 41 this->removeTagList(kViewArtist_SkTagList); |
| 42 } | 42 } |
| 43 else // add/replace | 43 else // add/replace |
| 44 { | 44 { |
| 45 Artist_SkTagList* rec = (Artist_SkTagList*)this->findTagList(kViewArtist
_SkTagList); | 45 Artist_SkTagList* rec = (Artist_SkTagList*)this->findTagList(kViewArtist
_SkTagList); |
| 46 | 46 |
| 47 if (rec) | 47 if (rec) |
| 48 SkRefCnt_SafeAssign(rec->fArtist, obj); | 48 SkRefCnt_SafeAssign(rec->fArtist, obj); |
| 49 else | 49 else |
| (...skipping 18 matching lines...) Expand all Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 void SkView::Layout::onInflate(const SkDOM&, const SkDOM::Node*) | 70 void SkView::Layout::onInflate(const SkDOM&, const SkDOM::Node*) |
| 71 { | 71 { |
| 72 // subclass should override this as needed | 72 // subclass should override this as needed |
| 73 } | 73 } |
| 74 | 74 |
| 75 SkView::Layout* SkView::getLayout() const | 75 SkView::Layout* SkView::getLayout() const |
| 76 { | 76 { |
| 77 Layout_SkTagList* rec = (Layout_SkTagList*)this->findTagList(kViewLayout_SkT
agList); | 77 Layout_SkTagList* rec = (Layout_SkTagList*)this->findTagList(kViewLayout_SkT
agList); |
| 78 SkASSERT(rec == NULL || rec->fLayout != NULL); | 78 SkASSERT(rec == nullptr || rec->fLayout != nullptr); |
| 79 | 79 |
| 80 return rec ? rec->fLayout : NULL; | 80 return rec ? rec->fLayout : nullptr; |
| 81 } | 81 } |
| 82 | 82 |
| 83 SkView::Layout* SkView::setLayout(Layout* obj, bool invokeLayoutNow) | 83 SkView::Layout* SkView::setLayout(Layout* obj, bool invokeLayoutNow) |
| 84 { | 84 { |
| 85 if (obj == NULL) | 85 if (obj == nullptr) |
| 86 { | 86 { |
| 87 this->removeTagList(kViewLayout_SkTagList); | 87 this->removeTagList(kViewLayout_SkTagList); |
| 88 } | 88 } |
| 89 else // add/replace | 89 else // add/replace |
| 90 { | 90 { |
| 91 Layout_SkTagList* rec = (Layout_SkTagList*)this->findTagList(kViewLayout
_SkTagList); | 91 Layout_SkTagList* rec = (Layout_SkTagList*)this->findTagList(kViewLayout
_SkTagList); |
| 92 | 92 |
| 93 if (rec) | 93 if (rec) |
| 94 SkRefCnt_SafeAssign(rec->fLayout, obj); | 94 SkRefCnt_SafeAssign(rec->fLayout, obj); |
| 95 else | 95 else |
| 96 this->addTagList(new Layout_SkTagList(obj)); | 96 this->addTagList(new Layout_SkTagList(obj)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 if (invokeLayoutNow) | 99 if (invokeLayoutNow) |
| 100 this->invokeLayout(); | 100 this->invokeLayout(); |
| 101 | 101 |
| 102 return obj; | 102 return obj; |
| 103 } | 103 } |
| OLD | NEW |