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 "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 fill.setColor(SK_ColorLTGRAY);; | 148 fill.setColor(SK_ColorLTGRAY);; |
149 | 149 |
150 SkPaint stroke; | 150 SkPaint stroke; |
151 stroke.setStyle(SkPaint::kStroke_Style); | 151 stroke.setStyle(SkPaint::kStroke_Style); |
152 stroke.setStrokeWidth(3); | 152 stroke.setStrokeWidth(3); |
153 | 153 |
154 SkPictureRecorder recorder; | 154 SkPictureRecorder recorder; |
155 | 155 |
156 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth), | 156 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth), |
157 SkIntToScalar(kPicHeight)); | 157 SkIntToScalar(kPicHeight)); |
| 158 SkRect r = tri.getBounds(); |
| 159 r.outset(2.0f, 2.0f); // outset for stroke |
| 160 canvas->clipRect(r); |
158 // The saveLayer/restore block is to exercise layer hoisting | 161 // The saveLayer/restore block is to exercise layer hoisting |
159 canvas->saveLayer(NULL, NULL); | 162 canvas->saveLayer(NULL, NULL); |
160 canvas->drawPath(tri, fill); | 163 canvas->drawPath(tri, fill); |
161 canvas->drawPath(tri, stroke); | 164 canvas->drawPath(tri, stroke); |
162 canvas->restore(); | 165 canvas->restore(); |
163 | 166 |
164 return recorder.endRecording(); | 167 return recorder.endRecording(); |
165 } | 168 } |
166 | 169 |
167 static const SkPicture* make_sub_picture(const SkPicture* tri) { | 170 static const SkPicture* make_sub_picture(const SkPicture* tri) { |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 MultiPictureDraw::kTiled_Layout)
);) | 542 MultiPictureDraw::kTiled_Layout)
);) |
540 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti
_Content, | 543 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti
_Content, |
541 MultiPictureDraw::kTiled_Layout)
);) | 544 MultiPictureDraw::kTiled_Layout)
);) |
542 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu
lti_Content, | 545 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu
lti_Content, |
543 MultiPictureDraw::kTiled_Layout)
);) | 546 MultiPictureDraw::kTiled_Layout)
);) |
544 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co
ntent, | 547 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co
ntent, |
545 MultiPictureDraw::kTiled_Layout)
);) | 548 MultiPictureDraw::kTiled_Layout)
);) |
546 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Cont
ent, | 549 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Cont
ent, |
547 MultiPictureDraw::kTiled_Layout)
);) | 550 MultiPictureDraw::kTiled_Layout)
);) |
548 } | 551 } |
OLD | NEW |