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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 (*gLayoutMthds[fLayout])(canvas, &mpd, | 504 (*gLayoutMthds[fLayout])(canvas, &mpd, |
505 gContentMthds[fContent], | 505 gContentMthds[fContent], |
506 fPictures, &composeSteps); | 506 fPictures, &composeSteps); |
507 | 507 |
508 mpd.draw(); | 508 mpd.draw(); |
509 | 509 |
510 // Compose all the drawn canvases into the final canvas | 510 // Compose all the drawn canvases into the final canvas |
511 for (int i = 0; i < composeSteps.count(); ++i) { | 511 for (int i = 0; i < composeSteps.count(); ++i) { |
512 const ComposeStep& step = composeSteps[i]; | 512 const ComposeStep& step = composeSteps[i]; |
513 | 513 |
514 SkAutoTUnref<SkImage> image(step.fSurf->newImageSnapshot()); | 514 canvas->drawImage(step.fSurf->makeImageSnapshot().get(), |
515 | 515 step.fX, step.fY, step.fPaint); |
516 canvas->drawImage(image, step.fX, step.fY, step.fPaint); | |
517 } | 516 } |
518 } | 517 } |
519 | 518 |
520 SkISize onISize() override { return SkISize::Make(kPicWidth, kPicHeight)
; } | 519 SkISize onISize() override { return SkISize::Make(kPicWidth, kPicHeight)
; } |
521 | 520 |
522 SkString onShortName() override { | 521 SkString onShortName() override { |
523 static const char* gContentNames[] = { | 522 static const char* gContentNames[] = { |
524 "noclip", "rectclip", "rrectclip", "pathclip", | 523 "noclip", "rectclip", "rrectclip", "pathclip", |
525 "invpathclip", "sierpinski", "biglayer" | 524 "invpathclip", "sierpinski", "biglayer" |
526 }; | 525 }; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 MultiPictureDraw::kTiled_Layout);) | 565 MultiPictureDraw::kTiled_Layout);) |
567 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kPathClipMulti_Content, | 566 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kPathClipMulti_Content, |
568 MultiPictureDraw::kTiled_Layout);) | 567 MultiPictureDraw::kTiled_Layout);) |
569 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kInvPathClipMulti_Conte
nt, | 568 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kInvPathClipMulti_Conte
nt, |
570 MultiPictureDraw::kTiled_Layout);) | 569 MultiPictureDraw::kTiled_Layout);) |
571 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kSierpinski_Content, | 570 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kSierpinski_Content, |
572 MultiPictureDraw::kTiled_Layout);) | 571 MultiPictureDraw::kTiled_Layout);) |
573 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kBigLayer_Content, | 572 DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kBigLayer_Content, |
574 MultiPictureDraw::kTiled_Layout);) | 573 MultiPictureDraw::kTiled_Layout);) |
575 } | 574 } |
OLD | NEW |