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

Side by Side Diff: gm/multipicturedraw.cpp

Issue 1034273002: Add matrix constructing helpers to SkMatrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/convexpolyeffect.cpp ('k') | gm/texturedomaineffect.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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 step.fX = SkIntToScalar(x*kTileWidth); 416 step.fX = SkIntToScalar(x*kTileWidth);
417 step.fY = SkIntToScalar(y*kTileHeight); 417 step.fY = SkIntToScalar(y*kTileHeight);
418 step.fPaint = SkNEW(SkPaint); 418 step.fPaint = SkNEW(SkPaint);
419 step.fPaint->setColorFilter( 419 step.fPaint->setColorFilter(
420 SkColorFilter::CreateModeFilter(colors[x][y], SkXfermode::kModul ate_Mode))->unref(); 420 SkColorFilter::CreateModeFilter(colors[x][y], SkXfermode::kModul ate_Mode))->unref();
421 421
422 step.fSurf = create_compat_surface(finalCanvas, kTileWidth, kTileHei ght); 422 step.fSurf = create_compat_surface(finalCanvas, kTileWidth, kTileHei ght);
423 423
424 SkCanvas* subCanvas = step.fSurf->getCanvas(); 424 SkCanvas* subCanvas = step.fSurf->getCanvas();
425 425
426 SkMatrix trans; 426 const SkMatrix trans = SkMatrix::MakeTrans(-SkIntToScalar(x*kTileWid th),
427 trans.setTranslate(-SkIntToScalar(x*kTileWidth), -SkIntToScalar(y*kT ileHeight)); 427 -SkIntToScalar(y*kTileHei ght));
428 428
429 create_content(mpd, pfGen, pictures, subCanvas, trans); 429 create_content(mpd, pfGen, pictures, subCanvas, trans);
430 } 430 }
431 } 431 }
432 } 432 }
433 433
434 static const PFLayoutMtd gLayoutMthds[] = { simple, tiled }; 434 static const PFLayoutMtd gLayoutMthds[] = { simple, tiled };
435 435
436 namespace skiagm { 436 namespace skiagm {
437 /** 437 /**
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 MultiPictureDraw::kTiled_Layout) );) 563 MultiPictureDraw::kTiled_Layout) );)
564 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content, 564 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content,
565 MultiPictureDraw::kTiled_Layout) );) 565 MultiPictureDraw::kTiled_Layout) );)
566 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content, 566 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content,
567 MultiPictureDraw::kTiled_Layout) );) 567 MultiPictureDraw::kTiled_Layout) );)
568 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co ntent, 568 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co ntent,
569 MultiPictureDraw::kTiled_Layout) );) 569 MultiPictureDraw::kTiled_Layout) );)
570 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Cont ent, 570 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Cont ent,
571 MultiPictureDraw::kTiled_Layout) );) 571 MultiPictureDraw::kTiled_Layout) );)
572 } 572 }
OLDNEW
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698