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

Side by Side Diff: tests/CanvasTest.cpp

Issue 1925693002: remove 'deprecated' region from SkDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 4 years, 7 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 | « tests/AAClipTest.cpp ('k') | no next file » | 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "SkClipStack.h" 48 #include "SkClipStack.h"
49 #include "SkDocument.h" 49 #include "SkDocument.h"
50 #include "SkMatrix.h" 50 #include "SkMatrix.h"
51 #include "SkNWayCanvas.h" 51 #include "SkNWayCanvas.h"
52 #include "SkPaint.h" 52 #include "SkPaint.h"
53 #include "SkPaintFilterCanvas.h" 53 #include "SkPaintFilterCanvas.h"
54 #include "SkPath.h" 54 #include "SkPath.h"
55 #include "SkPicture.h" 55 #include "SkPicture.h"
56 #include "SkPictureRecord.h" 56 #include "SkPictureRecord.h"
57 #include "SkPictureRecorder.h" 57 #include "SkPictureRecorder.h"
58 #include "SkRasterClip.h"
58 #include "SkRect.h" 59 #include "SkRect.h"
59 #include "SkRegion.h" 60 #include "SkRegion.h"
60 #include "SkShader.h" 61 #include "SkShader.h"
61 #include "SkStream.h" 62 #include "SkStream.h"
62 #include "SkSurface.h" 63 #include "SkSurface.h"
63 #include "SkTemplates.h" 64 #include "SkTemplates.h"
64 #include "SkTDArray.h" 65 #include "SkTDArray.h"
65 #include "Test.h" 66 #include "Test.h"
66 67
67 static const int kWidth = 2, kHeight = 2; 68 static const int kWidth = 2, kHeight = 2;
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 class CanvasTestingAccess { 501 class CanvasTestingAccess {
501 public: 502 public:
502 static bool SameState(const SkCanvas* canvas1, const SkCanvas* canvas2) { 503 static bool SameState(const SkCanvas* canvas1, const SkCanvas* canvas2) {
503 SkCanvas::LayerIter layerIter1(const_cast<SkCanvas*>(canvas1), false); 504 SkCanvas::LayerIter layerIter1(const_cast<SkCanvas*>(canvas1), false);
504 SkCanvas::LayerIter layerIter2(const_cast<SkCanvas*>(canvas2), false); 505 SkCanvas::LayerIter layerIter2(const_cast<SkCanvas*>(canvas2), false);
505 while (!layerIter1.done() && !layerIter2.done()) { 506 while (!layerIter1.done() && !layerIter2.done()) {
506 if (layerIter1.matrix() != layerIter2.matrix()) { 507 if (layerIter1.matrix() != layerIter2.matrix()) {
507 return false; 508 return false;
508 } 509 }
509 if (layerIter1.clip() != layerIter2.clip()) { 510 if (layerIter1.clip() != layerIter2.clip()) {
510 return false; 511 return false;
511 } 512 }
512 if (layerIter1.paint() != layerIter2.paint()) { 513 if (layerIter1.paint() != layerIter2.paint()) {
513 return false; 514 return false;
514 } 515 }
515 if (layerIter1.x() != layerIter2.x()) { 516 if (layerIter1.x() != layerIter2.x()) {
516 return false; 517 return false;
517 } 518 }
518 if (layerIter1.y() != layerIter2.y()) { 519 if (layerIter1.y() != layerIter2.y()) {
519 return false; 520 return false;
520 } 521 }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix()); 766 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix());
766 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2)); 767 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2));
767 REPORTER_ASSERT(reporter, clip1 == clip2); 768 REPORTER_ASSERT(reporter, clip1 == clip2);
768 769
769 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100)); 770 filterCanvas.clipRect(SkRect::MakeXYWH(30.5f, 30.7f, 100, 100));
770 filterCanvas.scale(0.75f, 0.5f); 771 filterCanvas.scale(0.75f, 0.5f);
771 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix()); 772 REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMa trix());
772 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2)); 773 REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getCl ipBounds(&clip2));
773 REPORTER_ASSERT(reporter, clip1 == clip2); 774 REPORTER_ASSERT(reporter, clip1 == clip2);
774 } 775 }
OLDNEW
« no previous file with comments | « tests/AAClipTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698