Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: gm/multipicturedraw.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/mipmap.cpp ('k') | gm/ninepatchstretch.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « gm/mipmap.cpp ('k') | gm/ninepatchstretch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698