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 "SkWidgetViews.h" | 8 #include "SkWidgetViews.h" |
9 #include "SkAnimator.h" | 9 #include "SkAnimator.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 "common/default/default/skins/scrollBar.xml", | 35 "common/default/default/skins/scrollBar.xml", |
36 "common/default/default/skins/statictextpaint.xml" | 36 "common/default/default/skins/statictextpaint.xml" |
37 }; | 37 }; |
38 | 38 |
39 return gSkinPaths[se]; | 39 return gSkinPaths[se]; |
40 } | 40 } |
41 | 41 |
42 void init_skin_anim(const char path[], SkAnimator* anim) { | 42 void init_skin_anim(const char path[], SkAnimator* anim) { |
43 SkASSERT(path && anim); | 43 SkASSERT(path && anim); |
44 | 44 |
45 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); | 45 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); |
46 if (!stream.get()) { | 46 if (!stream.get()) { |
47 SkDEBUGF(("init_skin_anim: loading skin failed <%s>\n", path)); | 47 SkDEBUGF(("init_skin_anim: loading skin failed <%s>\n", path)); |
48 sk_throw(); | 48 sk_throw(); |
49 } | 49 } |
50 | 50 |
51 if (!anim->decodeStream(stream)) { | 51 if (!anim->decodeStream(stream)) { |
52 SkDEBUGF(("init_skin_anim: decoding skin failed <%s>\n", path)); | 52 SkDEBUGF(("init_skin_anim: decoding skin failed <%s>\n", path)); |
53 sk_throw(); | 53 sk_throw(); |
54 } | 54 } |
55 } | 55 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 case kScroll_WidgetEnum: | 389 case kScroll_WidgetEnum: |
390 return new SkScrollBarView; | 390 return new SkScrollBarView; |
391 case kText_WidgetEnum: | 391 case kText_WidgetEnum: |
392 return new SkStaticTextView; | 392 return new SkStaticTextView; |
393 default: | 393 default: |
394 SkDEBUGFAIL("unknown enum passed to SkWidgetFactory"); | 394 SkDEBUGFAIL("unknown enum passed to SkWidgetFactory"); |
395 break; | 395 break; |
396 } | 396 } |
397 return NULL; | 397 return NULL; |
398 } | 398 } |
OLD | NEW |