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

Side by Side Diff: tests/RecordReplaceDrawTest.cpp

Issue 1410343011: Revert[2] of "stop using drawSprite (at least w/ no filters) as it is going away" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/images/SkImageDecoder.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 2014 Google Inc. 2 * Copyright 2014 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 #include "Test.h" 8 #include "Test.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), nullptr/*callba ck*/); 135 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), nullptr/*callba ck*/);
136 136
137 int recount = rerecord.count(); 137 int recount = rerecord.count();
138 REPORTER_ASSERT(r, 2 == recount || 4 == recount); 138 REPORTER_ASSERT(r, 2 == recount || 4 == recount);
139 139
140 int index = 0; 140 int index = 0;
141 if (4 == recount) { 141 if (4 == recount) {
142 assert_type<SkRecords::Save>(r, rerecord, 0); 142 assert_type<SkRecords::Save>(r, rerecord, 0);
143 index += 1; 143 index += 1;
144 } 144 }
145 assert_type<SkRecords::DrawSprite>(r, rerecord, index + 0); 145 assert_type<SkRecords::DrawBitmap>(r, rerecord, index + 0);
146 assert_type<SkRecords::DrawRect>(r, rerecord, index + 1); 146 assert_type<SkRecords::DrawRect>(r, rerecord, index + 1);
147 if (4 == recount) { 147 if (4 == recount) {
148 assert_type<SkRecords::Restore>(r, rerecord, 3); 148 assert_type<SkRecords::Restore>(r, rerecord, 3);
149 } 149 }
150 } 150 }
151 151
152 DEF_GPUTEST(RecordReplaceDraw, r, factory) { 152 DEF_GPUTEST(RecordReplaceDraw, r, factory) {
153 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { 153 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
154 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G LContextType>(type); 154 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G LContextType>(type);
155 if (!GrContextFactory::IsRenderingGLContext(glType)) { 155 if (!GrContextFactory::IsRenderingGLContext(glType)) {
156 continue; 156 continue;
157 } 157 }
158 GrContext* context = factory->get(glType); 158 GrContext* context = factory->get(glType);
159 if (nullptr == context) { 159 if (nullptr == context) {
160 continue; 160 continue;
161 } 161 }
162 162
163 test_replacements(r, context, true); 163 test_replacements(r, context, true);
164 test_replacements(r, context, false); 164 test_replacements(r, context, false);
165 } 165 }
166 } 166 }
167 167
168 #endif 168 #endif
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698