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

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: Moved code around to make code review easier 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 static ErrorCombination generate_image(GM* gm, const ConfigData& gRec, 510 static ErrorCombination generate_image(GM* gm, const ConfigData& gRec,
511 GrSurface* gpuTarget, 511 GrSurface* gpuTarget,
512 SkBitmap* bitmap, 512 SkBitmap* bitmap,
513 bool deferred) { 513 bool deferred) {
514 SkISize size (gm->getISize()); 514 SkISize size (gm->getISize());
515 setup_bitmap(gRec, size, bitmap); 515 setup_bitmap(gRec, size, bitmap);
516 516
517 SkAutoTUnref<SkCanvas> canvas; 517 SkAutoTUnref<SkCanvas> canvas;
518 518
519 if (gRec.fBackend == kRaster_Backend) { 519 if (gRec.fBackend == kRaster_Backend) {
520 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*bitmap))); 520 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkRasterDevice, (*bitmap))) ;
521 if (deferred) { 521 if (deferred) {
522 canvas.reset(SkDeferredCanvas::Create(device)); 522 canvas.reset(SkDeferredCanvas::Create(device));
523 } else { 523 } else {
524 canvas.reset(SkNEW_ARGS(SkCanvas, (device))); 524 canvas.reset(SkNEW_ARGS(SkCanvas, (device)));
525 } 525 }
526 invokeGM(gm, canvas, false, deferred); 526 invokeGM(gm, canvas, false, deferred);
527 canvas->flush(); 527 canvas->flush();
528 } 528 }
529 #if SK_SUPPORT_GPU 529 #if SK_SUPPORT_GPU
530 else { // GPU 530 else { // GPU
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 if (FLAGS_forceBWtext) { 2127 if (FLAGS_forceBWtext) {
2128 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); 2128 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref();
2129 } 2129 }
2130 } 2130 }
2131 2131
2132 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 2132 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
2133 int main(int argc, char * const argv[]) { 2133 int main(int argc, char * const argv[]) {
2134 return tool_main(argc, (char**) argv); 2134 return tool_main(argc, (char**) argv);
2135 } 2135 }
2136 #endif 2136 #endif
OLDNEW
« no previous file with comments | « gm/displacement.cpp ('k') | gm/imagefiltersgraph.cpp » ('j') | include/core/SkDevice.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698