OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 SkRect clipRect = rect; | 58 SkRect clipRect = rect; |
59 // This clip will always contain the entire rect. It's here to give
the GPU batching | 59 // This clip will always contain the entire rect. It's here to give
the GPU batching |
60 // code a little more challenge. | 60 // code a little more challenge. |
61 clipRect.outset(10, 10); | 61 clipRect.outset(10, 10); |
62 canvas->clipRect(clipRect); | 62 canvas->clipRect(clipRect); |
63 SkPaint paint; | 63 SkPaint paint; |
64 paint.setColor(fRandom.nextU()); | 64 paint.setColor(fRandom.nextU()); |
65 canvas->drawRect(rect, paint); | 65 canvas->drawRect(rect, paint); |
66 canvas->restore(); | 66 canvas->restore(); |
67 } | 67 } |
68 this->inval(NULL); | 68 this->inval(nullptr); |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
72 SkRandom fRandom; | 72 SkRandom fRandom; |
73 typedef SampleView INHERITED; | 73 typedef SampleView INHERITED; |
74 }; | 74 }; |
75 | 75 |
76 ////////////////////////////////////////////////////////////////////////////// | 76 ////////////////////////////////////////////////////////////////////////////// |
77 | 77 |
78 static SkView* MyFactory() { return new ManyRectsView; } | 78 static SkView* MyFactory() { return new ManyRectsView; } |
79 static SkViewRegister reg(MyFactory); | 79 static SkViewRegister reg(MyFactory); |
OLD | NEW |