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

Side by Side Diff: tests/CanvasTest.cpp

Issue 2120333002: deferred canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: override drawTextRSXform Created 4 years, 5 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
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tools/DumpRecord.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 /* Description: 8 /* Description:
9 * This test defines a series of elementatry test steps that perform 9 * This test defines a series of elementatry test steps that perform
10 * a single or a small group of canvas API calls. Each test step is 10 * a single or a small group of canvas API calls. Each test step is
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix()); 806 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix());
807 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2)); 807 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2));
808 REPORTER_ASSERT(reporter, clip1 == clip2); 808 REPORTER_ASSERT(reporter, clip1 == clip2);
809 809
810 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); 810 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100));
811 filterCanvas.scale(0.75f, 0.5f); 811 filterCanvas.scale(0.75f, 0.5f);
812 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix()); 812 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix());
813 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2)); 813 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2));
814 REPORTER_ASSERT(reporter, clip1 == clip2); 814 REPORTER_ASSERT(reporter, clip1 == clip2);
815 } 815 }
816
817 //////////////////////////////////////////////////////////////////////////////// ///////////////////
818
819 #include "SkDeferredCanvas.h"
820 #include "SkDumpCanvas.h"
821
822 DEF_TEST(DeferredCanvas, r) {
823 SkDebugfDumper dumper;
824 SkDumpCanvas dumpC(&dumper);
825
826 SkDeferredCanvas canvas(&dumpC);
827
828 SkPaint paint;
829 // paint.setShader(SkShader::MakeColorShader(SK_ColorRED));
830
831 canvas.save();
832 canvas.clipRect(SkRect::MakeWH(55, 55));
833 canvas.translate(10, 20);
834 canvas.drawRect(SkRect::MakeWH(50, 50), paint);
835 canvas.restore();
836 }
837
OLDNEW
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tools/DumpRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698