| 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 | 8 |
| 9 | 9 |
| 10 #ifndef SampleCode_DEFINED | 10 #ifndef SampleCode_DEFINED |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 /////////////////////////////////////////////////////////////////////////////// | 104 /////////////////////////////////////////////////////////////////////////////// |
| 105 | 105 |
| 106 class SampleView : public SkView { | 106 class SampleView : public SkView { |
| 107 public: | 107 public: |
| 108 SampleView() | 108 SampleView() |
| 109 : fPipeState(SkOSMenu::kOffState) | 109 : fPipeState(SkOSMenu::kOffState) |
| 110 , fBGColor(SK_ColorWHITE) | 110 , fBGColor(SK_ColorWHITE) |
| 111 , fRepeatCount(1) | 111 , fRepeatCount(1) |
| 112 , fDebugHitTest(false) { | 112 {} |
| 113 } | |
| 114 | 113 |
| 115 void setBGColor(SkColor color) { fBGColor = color; } | 114 void setBGColor(SkColor color) { fBGColor = color; } |
| 116 | 115 |
| 117 static bool IsSampleView(SkView*); | 116 static bool IsSampleView(SkView*); |
| 118 static bool SetRepeatDraw(SkView*, int count); | 117 static bool SetRepeatDraw(SkView*, int count); |
| 119 static bool SetUsePipe(SkView*, SkOSMenu::TriState); | 118 static bool SetUsePipe(SkView*, SkOSMenu::TriState); |
| 120 | 119 |
| 121 /** | 120 /** |
| 122 * Call this to request menu items from a SampleView. | 121 * Call this to request menu items from a SampleView. |
| 123 * Subclassing notes: A subclass of SampleView can overwrite this method | 122 * Subclassing notes: A subclass of SampleView can overwrite this method |
| (...skipping 14 matching lines...) Expand all Loading... |
| 138 virtual bool onQuery(SkEvent* evt); | 137 virtual bool onQuery(SkEvent* evt); |
| 139 virtual void draw(SkCanvas*); | 138 virtual void draw(SkCanvas*); |
| 140 virtual void onDraw(SkCanvas*); | 139 virtual void onDraw(SkCanvas*); |
| 141 | 140 |
| 142 SkOSMenu::TriState fPipeState; | 141 SkOSMenu::TriState fPipeState; |
| 143 SkColor fBGColor; | 142 SkColor fBGColor; |
| 144 | 143 |
| 145 private: | 144 private: |
| 146 int fRepeatCount; | 145 int fRepeatCount; |
| 147 | 146 |
| 148 bool fDebugHitTest; | |
| 149 SkIPoint fDebugHitTestLoc; | |
| 150 | |
| 151 typedef SkView INHERITED; | 147 typedef SkView INHERITED; |
| 152 }; | 148 }; |
| 153 | 149 |
| 154 #endif | 150 #endif |
| OLD | NEW |