OLD | NEW |
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 gm->draw(canvas); | 554 gm->draw(canvas); |
555 canvas->setDrawFilter(NULL); | 555 canvas->setDrawFilter(NULL); |
556 } | 556 } |
557 | 557 |
558 static ErrorCombination generate_image(GM* gm, const ConfigData& gRec, | 558 static ErrorCombination generate_image(GM* gm, const ConfigData& gRec, |
559 GrSurface* gpuTarget, | 559 GrSurface* gpuTarget, |
560 SkBitmap* bitmap, | 560 SkBitmap* bitmap, |
561 bool deferred) { | 561 bool deferred) { |
562 SkISize size (gm->getISize()); | 562 SkISize size (gm->getISize()); |
563 setup_bitmap(gRec, size, bitmap); | 563 setup_bitmap(gRec, size, bitmap); |
564 SkImageInfo info; | 564 const SkImageInfo info = bitmap->info(); |
565 bitmap->asImageInfo(&info); | |
566 | 565 |
567 SkAutoTUnref<SkSurface> surface; | 566 SkAutoTUnref<SkSurface> surface; |
568 SkAutoTUnref<SkCanvas> canvas; | 567 SkAutoTUnref<SkCanvas> canvas; |
569 | 568 |
570 if (gRec.fBackend == kRaster_Backend) { | 569 if (gRec.fBackend == kRaster_Backend) { |
571 surface.reset(SkSurface::NewRasterDirect(info, | 570 surface.reset(SkSurface::NewRasterDirect(info, |
572 bitmap->getPixels(), | 571 bitmap->getPixels(), |
573 bitmap->rowBytes())); | 572 bitmap->rowBytes())); |
574 if (deferred) { | 573 if (deferred) { |
575 canvas.reset(SkDeferredCanvas::Create(surface)); | 574 canvas.reset(SkDeferredCanvas::Create(surface)); |
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 if (FLAGS_forceBWtext) { | 2466 if (FLAGS_forceBWtext) { |
2468 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2467 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2469 } | 2468 } |
2470 } | 2469 } |
2471 | 2470 |
2472 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2471 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2473 int main(int argc, char * const argv[]) { | 2472 int main(int argc, char * const argv[]) { |
2474 return tool_main(argc, (char**) argv); | 2473 return tool_main(argc, (char**) argv); |
2475 } | 2474 } |
2476 #endif | 2475 #endif |
OLD | NEW |