OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 SkCanvas c(bm); | 87 SkCanvas c(bm); |
88 | 88 |
89 Canvas2CanvasClipVisitor visitor(&c); | 89 Canvas2CanvasClipVisitor visitor(&c); |
90 canvas->replayClips(&visitor); | 90 canvas->replayClips(&visitor); |
91 | 91 |
92 REPORTER_ASSERT(reporter, c.getTotalClip() == canvas->getTotalClip()); | 92 REPORTER_ASSERT(reporter, c.getTotalClip() == canvas->getTotalClip()); |
93 } | 93 } |
94 | 94 |
95 static const int kWidth = 2; | 95 static const int kWidth = 2; |
96 static const int kHeight = 2; | 96 static const int kHeight = 2; |
97 // Maximum stream length for picture serialization | |
98 static const size_t kMaxPictureBufferSize = 1024; | |
99 | 97 |
100 // Format strings that describe the test context. The %s token is where | 98 // Format strings that describe the test context. The %s token is where |
101 // the name of the test step is inserted. The context is required for | 99 // the name of the test step is inserted. The context is required for |
102 // disambiguating the error in the case of failures that are reported in | 100 // disambiguating the error in the case of failures that are reported in |
103 // functions that are called multiple times in different contexts (test | 101 // functions that are called multiple times in different contexts (test |
104 // cases and test steps). | 102 // cases and test steps). |
105 static const char* const kDefaultAssertMessageFormat = "%s"; | 103 static const char* const kDefaultAssertMessageFormat = "%s"; |
106 static const char* const kCanvasDrawAssertMessageFormat = | 104 static const char* const kCanvasDrawAssertMessageFormat = |
107 "Drawing test step %s with SkCanvas"; | 105 "Drawing test step %s with SkCanvas"; |
108 static const char* const kPictureDrawAssertMessageFormat = | 106 static const char* const kPictureDrawAssertMessageFormat = |
109 "Drawing test step %s with SkPicture"; | 107 "Drawing test step %s with SkPicture"; |
110 static const char* const kPictureSecondDrawAssertMessageFormat = | 108 static const char* const kPictureSecondDrawAssertMessageFormat = |
111 "Duplicate draw of test step %s with SkPicture"; | 109 "Duplicate draw of test step %s with SkPicture"; |
112 static const char* const kPictureReDrawAssertMessageFormat = | |
113 "Playing back test step %s from an SkPicture to another SkPicture"; | |
114 static const char* const kDeferredDrawAssertMessageFormat = | 110 static const char* const kDeferredDrawAssertMessageFormat = |
115 "Drawing test step %s with SkDeferredCanvas"; | 111 "Drawing test step %s with SkDeferredCanvas"; |
116 static const char* const kProxyDrawAssertMessageFormat = | 112 static const char* const kProxyDrawAssertMessageFormat = |
117 "Drawing test step %s with SkProxyCanvas"; | 113 "Drawing test step %s with SkProxyCanvas"; |
118 static const char* const kNWayDrawAssertMessageFormat = | 114 static const char* const kNWayDrawAssertMessageFormat = |
119 "Drawing test step %s with SkNWayCanvas"; | 115 "Drawing test step %s with SkNWayCanvas"; |
120 static const char* const kRoundTripAssertMessageFormat = | |
121 "test step %s, SkPicture consistency after round trip"; | |
122 static const char* const kPictureRecoringAssertMessageFormat = | |
123 "test step %s, SkPicture state consistency after recording"; | |
124 static const char* const kPicturePlaybackAssertMessageFormat = | |
125 "test step %s, SkPicture state consistency in playback canvas"; | |
126 static const char* const kDeferredPreFlushAssertMessageFormat = | 116 static const char* const kDeferredPreFlushAssertMessageFormat = |
127 "test step %s, SkDeferredCanvas state consistency before flush"; | 117 "test step %s, SkDeferredCanvas state consistency before flush"; |
128 static const char* const kDeferredPostFlushPlaybackAssertMessageFormat = | 118 static const char* const kDeferredPostFlushPlaybackAssertMessageFormat = |
129 "test step %s, SkDeferredCanvas playback canvas state consistency after flus
h"; | 119 "test step %s, SkDeferredCanvas playback canvas state consistency after flus
h"; |
130 static const char* const kDeferredPostSilentFlushPlaybackAssertMessageFormat = | 120 static const char* const kDeferredPostSilentFlushPlaybackAssertMessageFormat = |
131 "test step %s, SkDeferredCanvas playback canvas state consistency after sile
nt flush"; | 121 "test step %s, SkDeferredCanvas playback canvas state consistency after sile
nt flush"; |
132 static const char* const kDeferredPostFlushAssertMessageFormat = | |
133 "test step %s, SkDeferredCanvas state consistency after flush"; | |
134 static const char* const kPictureResourceReuseMessageFormat = | 122 static const char* const kPictureResourceReuseMessageFormat = |
135 "test step %s, SkPicture duplicate flattened object test"; | 123 "test step %s, SkPicture duplicate flattened object test"; |
136 static const char* const kProxyStateAssertMessageFormat = | 124 static const char* const kProxyStateAssertMessageFormat = |
137 "test step %s, SkProxyCanvas state consistency"; | 125 "test step %s, SkProxyCanvas state consistency"; |
138 static const char* const kProxyIndirectStateAssertMessageFormat = | 126 static const char* const kProxyIndirectStateAssertMessageFormat = |
139 "test step %s, SkProxyCanvas indirect canvas state consistency"; | 127 "test step %s, SkProxyCanvas indirect canvas state consistency"; |
140 static const char* const kNWayStateAssertMessageFormat = | 128 static const char* const kNWayStateAssertMessageFormat = |
141 "test step %s, SkNWayCanvas state consistency"; | 129 "test step %s, SkNWayCanvas state consistency"; |
142 static const char* const kNWayIndirect1StateAssertMessageFormat = | 130 static const char* const kNWayIndirect1StateAssertMessageFormat = |
143 "test step %s, SkNWayCanvas indirect canvas 1 state consistency"; | 131 "test step %s, SkNWayCanvas indirect canvas 1 state consistency"; |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 TestPdfDevice(reporter, testStepArray()[testStep]); | 914 TestPdfDevice(reporter, testStepArray()[testStep]); |
927 } | 915 } |
928 } | 916 } |
929 | 917 |
930 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i
s a global) | 918 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i
s a global) |
931 kTestBitmap.reset(); | 919 kTestBitmap.reset(); |
932 } | 920 } |
933 | 921 |
934 #include "TestClassDef.h" | 922 #include "TestClassDef.h" |
935 DEFINE_TESTCLASS("Canvas", TestCanvasClass, TestCanvas) | 923 DEFINE_TESTCLASS("Canvas", TestCanvasClass, TestCanvas) |
OLD | NEW |