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

Side by Side Diff: gm/gmmain.cpp

Issue 305483005: remove SkBitmap::asImageInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | gyp/skia_for_chromium_defines.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | gyp/skia_for_chromium_defines.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698