epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 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 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 7 | #ifndef SkViewPriv_DEFINED |
| 8 | #define SkViewPriv_DEFINED |
| 9 | |
| 10 | #include "SkView.h" |
| 11 | #include "SkTagList.h" |
| 12 | |
| 13 | struct Layout_SkTagList : SkTagList { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 14 | SkView::Layout* fLayout; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 15 | |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 16 | Layout_SkTagList(SkView::Layout* layout) |
| 17 | : SkTagList(kViewLayout_SkTagList), fLayout(layout) |
| 18 | { |
| 19 | SkASSERT(layout); |
| 20 | layout->ref(); |
| 21 | } |
| 22 | virtual ~Layout_SkTagList() |
| 23 | { |
| 24 | fLayout->unref(); |
| 25 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | struct Artist_SkTagList : SkTagList { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 29 | SkView::Artist* fArtist; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 30 | |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 31 | Artist_SkTagList(SkView::Artist* artist) |
| 32 | : SkTagList(kViewArtist_SkTagList), fArtist(artist) |
| 33 | { |
| 34 | SkASSERT(artist); |
| 35 | artist->ref(); |
| 36 | } |
| 37 | virtual ~Artist_SkTagList() |
| 38 | { |
| 39 | fArtist->unref(); |
| 40 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | #endif |