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

Side by Side Diff: tests/LayerRasterizerTest.cpp

Issue 841753002: Remove macros that make it look like it's a good idea to not be able to flatten. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: DummyRasterizer too Created 5 years, 11 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/core/SkDraw.cpp ('k') | tests/QuickRejectTest.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 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 "SkDeque.h" 8 #include "SkDeque.h"
9 #include "SkLayerRasterizer.h" 9 #include "SkLayerRasterizer.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 15 matching lines...) Expand all
26 gCount++; 26 gCount++;
27 } 27 }
28 28
29 ~DummyRasterizer() { 29 ~DummyRasterizer() {
30 // Not threadsafe. Only used in one thread. 30 // Not threadsafe. Only used in one thread.
31 gCount--; 31 gCount--;
32 } 32 }
33 33
34 static int GetCount() { return gCount; } 34 static int GetCount() { return gCount; }
35 35
36 SK_DECLARE_NOT_FLATTENABLE_PROCS(DummyRasterizer) 36 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyRasterizer);
37 37
38 private: 38 private:
39 static int gCount; 39 static int gCount;
40 40
41 typedef SkRasterizer INHERITED; 41 typedef SkRasterizer INHERITED;
42 }; 42 };
43 43
44 int DummyRasterizer::gCount; 44 int DummyRasterizer::gCount;
45 45
46 SkFlattenable* DummyRasterizer::CreateProc(SkReadBuffer&) {
47 return SkNEW(DummyRasterizer);
48 }
49
46 // Check to make sure that the SkPaint in the layer has its destructor called. 50 // Check to make sure that the SkPaint in the layer has its destructor called.
47 DEF_TEST(LayerRasterizer_destructor, reporter) { 51 DEF_TEST(LayerRasterizer_destructor, reporter) {
48 { 52 {
49 SkPaint paint; 53 SkPaint paint;
50 paint.setRasterizer(SkNEW(DummyRasterizer))->unref(); 54 paint.setRasterizer(SkNEW(DummyRasterizer))->unref();
51 REPORTER_ASSERT(reporter, DummyRasterizer::GetCount() == 1); 55 REPORTER_ASSERT(reporter, DummyRasterizer::GetCount() == 1);
52 56
53 SkLayerRasterizer::Builder builder; 57 SkLayerRasterizer::Builder builder;
54 builder.addLayer(paint); 58 builder.addLayer(paint);
55 } 59 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } else { 137 } else {
134 REPORTER_ASSERT(reporter, equals(*recFirstCopy, *recOneLarger)); 138 REPORTER_ASSERT(reporter, equals(*recFirstCopy, *recOneLarger));
135 } 139 }
136 } 140 }
137 } 141 }
138 142
139 DEF_TEST(LayerRasterizer_detachEmpty, reporter) { 143 DEF_TEST(LayerRasterizer_detachEmpty, reporter) {
140 SkLayerRasterizer::Builder builder; 144 SkLayerRasterizer::Builder builder;
141 REPORTER_ASSERT(reporter, NULL == builder.detachRasterizer()); 145 REPORTER_ASSERT(reporter, NULL == builder.detachRasterizer());
142 } 146 }
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | tests/QuickRejectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698