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

Side by Side Diff: gm/gmmain.cpp

Issue 540963002: Change SkPicture::draw to playback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 /* 8 /*
9 * Code for the "gm" (Golden Master) rendering comparison tool. 9 * Code for the "gm" (Golden Master) rendering comparison tool.
10 * 10 *
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 SkPaint bmpPaint; 626 SkPaint bmpPaint;
627 bmpPaint.setXfermodeMode(SkXfermode::kSrc_Mode); 627 bmpPaint.setXfermodeMode(SkXfermode::kSrc_Mode);
628 628
629 for (int yTile = 0; yTile < (size.height()+15)/16; ++yTile) { 629 for (int yTile = 0; yTile < (size.height()+15)/16; ++yTile) {
630 for (int xTile = 0; xTile < (size.width()+15)/16; ++xTile) { 630 for (int xTile = 0; xTile < (size.width()+15)/16; ++xTile) {
631 int saveCount = tileCanvas.save(); 631 int saveCount = tileCanvas.save();
632 SkMatrix mat(tileCanvas.getTotalMatrix()); 632 SkMatrix mat(tileCanvas.getTotalMatrix());
633 mat.postTranslate(SkIntToScalar(-xTile*tileSize.width()), 633 mat.postTranslate(SkIntToScalar(-xTile*tileSize.width()),
634 SkIntToScalar(-yTile*tileSize.height())); 634 SkIntToScalar(-yTile*tileSize.height()));
635 tileCanvas.setMatrix(mat); 635 tileCanvas.setMatrix(mat);
636 pict->draw(&tileCanvas); 636 pict->playback(&tileCanvas);
637 tileCanvas.flush(); 637 tileCanvas.flush();
638 tileCanvas.restoreToCount(saveCount); 638 tileCanvas.restoreToCount(saveCount);
639 bmpCanvas.drawBitmap(tileBM, 639 bmpCanvas.drawBitmap(tileBM,
640 SkIntToScalar(xTile * tileSize.width()) , 640 SkIntToScalar(xTile * tileSize.width()) ,
641 SkIntToScalar(yTile * tileSize.height() ), 641 SkIntToScalar(yTile * tileSize.height() ),
642 &bmpPaint); 642 &bmpPaint);
643 } 643 }
644 } 644 }
645 } else { 645 } else {
646 SkCanvas canvas(*bitmap); 646 SkCanvas canvas(*bitmap);
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 if (FLAGS_forceBWtext) { 2479 if (FLAGS_forceBWtext) {
2480 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); 2480 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref();
2481 } 2481 }
2482 } 2482 }
2483 2483
2484 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 2484 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
2485 int main(int argc, char * const argv[]) { 2485 int main(int argc, char * const argv[]) {
2486 return tool_main(argc, (char**) argv); 2486 return tool_main(argc, (char**) argv);
2487 } 2487 }
2488 #endif 2488 #endif
OLDNEW
« no previous file with comments | « gm/distantclip.cpp ('k') | gm/optimizations.cpp » ('j') | include/core/SkPicture.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698