| 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 "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkDumpCanvas.h" | 9 #include "SkDumpCanvas.h" |
| 10 #include "SkView.h" | 10 #include "SkView.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 SampleCode::TitleR(evt, "Picture"); | 97 SampleCode::TitleR(evt, "Picture"); |
| 98 return true; | 98 return true; |
| 99 } | 99 } |
| 100 return this->INHERITED::onQuery(evt); | 100 return this->INHERITED::onQuery(evt); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void drawSomething(SkCanvas* canvas) { | 103 void drawSomething(SkCanvas* canvas) { |
| 104 SkPaint paint; | 104 SkPaint paint; |
| 105 | 105 |
| 106 canvas->save(); | 106 canvas->save(); |
| 107 canvas->scale(SkFloatToScalar(0.5f), SkFloatToScalar(0.5f)); | 107 canvas->scale(0.5f, 0.5f); |
| 108 canvas->drawBitmap(fBitmap, 0, 0, NULL); | 108 canvas->drawBitmap(fBitmap, 0, 0, NULL); |
| 109 canvas->restore(); | 109 canvas->restore(); |
| 110 | 110 |
| 111 const char beforeStr[] = "before circle"; | 111 const char beforeStr[] = "before circle"; |
| 112 const char afterStr[] = "after circle"; | 112 const char afterStr[] = "after circle"; |
| 113 | 113 |
| 114 paint.setAntiAlias(true); | 114 paint.setAntiAlias(true); |
| 115 | 115 |
| 116 paint.setColor(SK_ColorRED); | 116 paint.setColor(SK_ColorRED); |
| 117 canvas->drawData(beforeStr, sizeof(beforeStr)); | 117 canvas->drawData(beforeStr, sizeof(beforeStr)); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 SkPicture* fPicture; | 191 SkPicture* fPicture; |
| 192 SkPicture* fSubPicture; | 192 SkPicture* fSubPicture; |
| 193 | 193 |
| 194 typedef SampleView INHERITED; | 194 typedef SampleView INHERITED; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 ////////////////////////////////////////////////////////////////////////////// | 197 ////////////////////////////////////////////////////////////////////////////// |
| 198 | 198 |
| 199 static SkView* MyFactory() { return new PictureView; } | 199 static SkView* MyFactory() { return new PictureView; } |
| 200 static SkViewRegister reg(MyFactory); | 200 static SkViewRegister reg(MyFactory); |
| OLD | NEW |