OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "DecodeFile.h" | 8 #include "DecodeFile.h" |
9 #include "gm.h" | 9 #include "gm.h" |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const char *text; | 58 const char *text; |
59 | 59 |
60 canvas->save(); | 60 canvas->save(); |
61 if (use_scale) { | 61 if (use_scale) { |
62 text = "Scaled = 1"; | 62 text = "Scaled = 1"; |
63 } else { | 63 } else { |
64 | 64 |
65 SkRect r = { 100, 100, 356, 356 }; | 65 SkRect r = { 100, 100, 356, 356 }; |
66 SkPath clipPath; | 66 SkPath clipPath; |
67 clipPath.addRoundRect(r, SkIntToScalar(5), SkIntToScalar(5)); | 67 clipPath.addRoundRect(r, SkIntToScalar(5), SkIntToScalar(5)); |
68 canvas->clipPath(clipPath, SkRegion::kIntersect_Op, SkToBool(1)); | 68 canvas->clipPath(clipPath, SkCanvas::kIntersect_Op, SkToBool(1)); |
69 text = "Scaled = 0"; | 69 text = "Scaled = 0"; |
70 } | 70 } |
71 canvas->drawBitmap( fBM, 100, 100, &paint ); | 71 canvas->drawBitmap( fBM, 100, 100, &paint ); |
72 canvas->restore(); | 72 canvas->restore(); |
73 canvas->drawText( text, strlen(text), 100, 400, paint ); | 73 canvas->drawText( text, strlen(text), 100, 400, paint ); |
74 this->inval(nullptr); | 74 this->inval(nullptr); |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 typedef SampleView INHERITED; | 78 typedef SampleView INHERITED; |
79 }; | 79 }; |
80 | 80 |
81 ////////////////////////////////////////////////////////////////////////////// | 81 ////////////////////////////////////////////////////////////////////////////// |
82 | 82 |
83 static SkView* MyFactory() { return new IdentityScaleView("mandrill_256.png"); } | 83 static SkView* MyFactory() { return new IdentityScaleView("mandrill_256.png"); } |
84 static SkViewRegister reg(MyFactory); | 84 static SkViewRegister reg(MyFactory); |
OLD | NEW |