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

Side by Side Diff: tests/CanvasTest.cpp

Issue 22385011: Removing deprecated constructors and setDevice from SkDeferredCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: 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
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tests/DeferredCanvasTest.cpp » ('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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 /* Description: 9 /* Description:
10 * This test defines a series of elementatry test steps that perform 10 * This test defines a series of elementatry test steps that perform
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 class SkDeferredCanvasTester { 773 class SkDeferredCanvasTester {
774 public: 774 public:
775 static void TestDeferredCanvasStateConsistency( 775 static void TestDeferredCanvasStateConsistency(
776 skiatest::Reporter* reporter, 776 skiatest::Reporter* reporter,
777 CanvasTestStep* testStep, 777 CanvasTestStep* testStep,
778 const SkCanvas& referenceCanvas, bool silent) { 778 const SkCanvas& referenceCanvas, bool silent) {
779 779
780 SkBitmap deferredStore; 780 SkBitmap deferredStore;
781 createBitmap(&deferredStore, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF); 781 createBitmap(&deferredStore, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
782 SkDevice deferredDevice(deferredStore); 782 SkDevice deferredDevice(deferredStore);
783 SkAutoTUnref<SkDeferredCanvas> deferredCanvas( 783 SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(& deferredDevice));
784 #if SK_DEFERRED_CANVAS_USES_FACTORIES
785 SkDeferredCanvas::Create(&deferredDevice));
786 #else
787 SkNEW_ARGS(SkDeferredCanvas, (&deferredDevice)));
788 #endif
789 testStep->setAssertMessageFormat(kDeferredDrawAssertMessageFormat); 784 testStep->setAssertMessageFormat(kDeferredDrawAssertMessageFormat);
790 testStep->draw(deferredCanvas, reporter); 785 testStep->draw(deferredCanvas, reporter);
791 testStep->setAssertMessageFormat(kDeferredPreFlushAssertMessageFormat); 786 testStep->setAssertMessageFormat(kDeferredPreFlushAssertMessageFormat);
792 AssertCanvasStatesEqual(reporter, deferredCanvas, &referenceCanvas, 787 AssertCanvasStatesEqual(reporter, deferredCanvas, &referenceCanvas,
793 testStep); 788 testStep);
794 789
795 if (silent) { 790 if (silent) {
796 deferredCanvas->silentFlush(); 791 deferredCanvas->silentFlush();
797 } else { 792 } else {
798 deferredCanvas->flush(); 793 deferredCanvas->flush();
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 TestPdfDevice(reporter, testStepArray()[testStep]); 926 TestPdfDevice(reporter, testStepArray()[testStep]);
932 } 927 }
933 } 928 }
934 929
935 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i s a global) 930 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i s a global)
936 kTestBitmap.reset(); 931 kTestBitmap.reset();
937 } 932 }
938 933
939 #include "TestClassDef.h" 934 #include "TestClassDef.h"
940 DEFINE_TESTCLASS("Canvas", TestCanvasClass, TestCanvas) 935 DEFINE_TESTCLASS("Canvas", TestCanvasClass, TestCanvas)
OLDNEW
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698