epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 8 | #ifndef SkViewPriv_DEFINED |
| 9 | #define SkViewPriv_DEFINED |
| 10 | |
| 11 | #include "SkView.h" |
| 12 | #include "SkTagList.h" |
| 13 | |
| 14 | struct Layout_SkTagList : SkTagList { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 15 | SkView::Layout* fLayout; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 16 | |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 17 | Layout_SkTagList(SkView::Layout* layout) |
| 18 | : SkTagList(kViewLayout_SkTagList), fLayout(layout) |
| 19 | { |
| 20 | SkASSERT(layout); |
| 21 | layout->ref(); |
| 22 | } |
| 23 | virtual ~Layout_SkTagList() |
| 24 | { |
| 25 | fLayout->unref(); |
| 26 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | struct Artist_SkTagList : SkTagList { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 30 | SkView::Artist* fArtist; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 31 | |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 32 | Artist_SkTagList(SkView::Artist* artist) |
| 33 | : SkTagList(kViewArtist_SkTagList), fArtist(artist) |
| 34 | { |
| 35 | SkASSERT(artist); |
| 36 | artist->ref(); |
| 37 | } |
| 38 | virtual ~Artist_SkTagList() |
| 39 | { |
| 40 | fArtist->unref(); |
| 41 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | #endif |