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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 surface.reset(SkSurface::NewRenderTargetDirect(gpuTarget->asRenderTa
rget())); | 583 surface.reset(SkSurface::NewRenderTargetDirect(gpuTarget->asRenderTa
rget())); |
584 if (deferred) { | 584 if (deferred) { |
585 canvas.reset(SkDeferredCanvas::Create(surface)); | 585 canvas.reset(SkDeferredCanvas::Create(surface)); |
586 } else { | 586 } else { |
587 canvas.reset(SkRef(surface->getCanvas())); | 587 canvas.reset(SkRef(surface->getCanvas())); |
588 } | 588 } |
589 invokeGM(gm, canvas, false, deferred); | 589 invokeGM(gm, canvas, false, deferred); |
590 // the device is as large as the current rendertarget, so | 590 // the device is as large as the current rendertarget, so |
591 // we explicitly only readback the amount we expect (in | 591 // we explicitly only readback the amount we expect (in |
592 // size) overwrite our previous allocation | 592 // size) overwrite our previous allocation |
593 bitmap->setInfo(SkImageInfo::MakeN32Premul(size.fWidth, size.fHeight
)); | 593 bitmap->setConfig(SkImageInfo::MakeN32Premul(size.fWidth, size.fHeig
ht)); |
594 canvas->readPixels(bitmap, 0, 0); | 594 canvas->readPixels(bitmap, 0, 0); |
595 } | 595 } |
596 #endif | 596 #endif |
597 complete_bitmap(bitmap); | 597 complete_bitmap(bitmap); |
598 return kEmpty_ErrorCombination; | 598 return kEmpty_ErrorCombination; |
599 } | 599 } |
600 | 600 |
601 static void generate_image_from_picture(GM* gm, const ConfigData& gRec, | 601 static void generate_image_from_picture(GM* gm, const ConfigData& gRec, |
602 SkPicture* pict, SkBitmap* bitmap, | 602 SkPicture* pict, SkBitmap* bitmap, |
603 SkScalar scale = SK_Scalar1, | 603 SkScalar scale = SK_Scalar1, |
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2466 if (FLAGS_forceBWtext) { | 2466 if (FLAGS_forceBWtext) { |
2467 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2467 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2468 } | 2468 } |
2469 } | 2469 } |
2470 | 2470 |
2471 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2471 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2472 int main(int argc, char * const argv[]) { | 2472 int main(int argc, char * const argv[]) { |
2473 return tool_main(argc, (char**) argv); | 2473 return tool_main(argc, (char**) argv); |
2474 } | 2474 } |
2475 #endif | 2475 #endif |
OLD | NEW |