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

Side by Side Diff: gm/gmmain.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: update to ToT, re-add SkBaseDevice::config & default parameter Created 7 years, 4 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 | Annotate | Revision Log
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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 static ErrorCombination generate_image(GM* gm, const ConfigData& gRec, 523 static ErrorCombination generate_image(GM* gm, const ConfigData& gRec,
524 GrSurface* gpuTarget, 524 GrSurface* gpuTarget,
525 SkBitmap* bitmap, 525 SkBitmap* bitmap,
526 bool deferred) { 526 bool deferred) {
527 SkISize size (gm->getISize()); 527 SkISize size (gm->getISize());
528 setup_bitmap(gRec, size, bitmap); 528 setup_bitmap(gRec, size, bitmap);
529 529
530 SkAutoTUnref<SkCanvas> canvas; 530 SkAutoTUnref<SkCanvas> canvas;
531 531
532 if (gRec.fBackend == kRaster_Backend) { 532 if (gRec.fBackend == kRaster_Backend) {
533 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*bitmap))); 533 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*bitma p)));
534 if (deferred) { 534 if (deferred) {
535 canvas.reset(SkDeferredCanvas::Create(device)); 535 canvas.reset(SkDeferredCanvas::Create(device));
536 } else { 536 } else {
537 canvas.reset(SkNEW_ARGS(SkCanvas, (device))); 537 canvas.reset(SkNEW_ARGS(SkCanvas, (device)));
538 } 538 }
539 invokeGM(gm, canvas, false, deferred); 539 invokeGM(gm, canvas, false, deferred);
540 canvas->flush(); 540 canvas->flush();
541 } 541 }
542 #if SK_SUPPORT_GPU 542 #if SK_SUPPORT_GPU
543 else { // GPU 543 else { // GPU
544 SkAutoTUnref<SkDevice> device(SkGpuDevice::Create(gpuTarget)); 544 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(gpuTarget));
545 if (deferred) { 545 if (deferred) {
546 canvas.reset(SkDeferredCanvas::Create(device)); 546 canvas.reset(SkDeferredCanvas::Create(device));
547 } else { 547 } else {
548 canvas.reset(SkNEW_ARGS(SkCanvas, (device))); 548 canvas.reset(SkNEW_ARGS(SkCanvas, (device)));
549 } 549 }
550 invokeGM(gm, canvas, false, deferred); 550 invokeGM(gm, canvas, false, deferred);
551 // the device is as large as the current rendertarget, so 551 // the device is as large as the current rendertarget, so
552 // we explicitly only readback the amount we expect (in 552 // we explicitly only readback the amount we expect (in
553 // size) overwrite our previous allocation 553 // size) overwrite our previous allocation
554 bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth, 554 bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth,
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 if (FLAGS_forceBWtext) { 2298 if (FLAGS_forceBWtext) {
2299 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); 2299 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref();
2300 } 2300 }
2301 } 2301 }
2302 2302
2303 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 2303 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
2304 int main(int argc, char * const argv[]) { 2304 int main(int argc, char * const argv[]) {
2305 return tool_main(argc, (char**) argv); 2305 return tool_main(argc, (char**) argv);
2306 } 2306 }
2307 #endif 2307 #endif
OLDNEW
« no previous file with comments | « gm/extractbitmap.cpp ('k') | gm/imagefiltersgraph.cpp » ('j') | include/core/SkDevice.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698