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

Side by Side Diff: tests/QuickRejectTest.cpp

Issue 1855733002: change flattenable factory to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/PDFPrimitivesTest.cpp ('k') | tools/debugger/SkDrawCommand.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 2011 Google Inc. 2 * Copyright 2011 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkDrawLooper.h" 9 #include "SkDrawLooper.h"
10 #include "SkTypes.h" 10 #include "SkTypes.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 canvas->translate(SkIntToScalar(10), 0); 42 canvas->translate(SkIntToScalar(10), 0);
43 return true; 43 return true;
44 } 44 }
45 return false; 45 return false;
46 } 46 }
47 private: 47 private:
48 bool fOnce; 48 bool fOnce;
49 }; 49 };
50 }; 50 };
51 51
52 SkFlattenable* TestLooper::CreateProc(SkReadBuffer&) { return new TestLooper; } 52 sk_sp<SkFlattenable> TestLooper::CreateProc(SkReadBuffer&) { return sk_make_sp<T estLooper>(); }
53 53
54 static void test_drawBitmap(skiatest::Reporter* reporter) { 54 static void test_drawBitmap(skiatest::Reporter* reporter) {
55 SkBitmap src; 55 SkBitmap src;
56 src.allocN32Pixels(10, 10); 56 src.allocN32Pixels(10, 10);
57 src.eraseColor(SK_ColorWHITE); 57 src.eraseColor(SK_ColorWHITE);
58 58
59 SkBitmap dst; 59 SkBitmap dst;
60 dst.allocN32Pixels(10, 10); 60 dst.allocN32Pixels(10, 10);
61 dst.eraseColor(SK_ColorTRANSPARENT); 61 dst.eraseColor(SK_ColorTRANSPARENT);
62 62
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 SkRect bounds = SkRect::MakeLTRB(50, 50, 70, 70); 100 SkRect bounds = SkRect::MakeLTRB(50, 50, 70, 70);
101 canvas.saveLayer(&bounds, nullptr); 101 canvas.saveLayer(&bounds, nullptr);
102 REPORTER_ASSERT(reporter, true == canvas.quickReject(SkRect::MakeWH(10, 10)) ); 102 REPORTER_ASSERT(reporter, true == canvas.quickReject(SkRect::MakeWH(10, 10)) );
103 REPORTER_ASSERT(reporter, false == canvas.quickReject(SkRect::MakeWH(60, 60) )); 103 REPORTER_ASSERT(reporter, false == canvas.quickReject(SkRect::MakeWH(60, 60) ));
104 } 104 }
105 105
106 DEF_TEST(QuickReject, reporter) { 106 DEF_TEST(QuickReject, reporter) {
107 test_drawBitmap(reporter); 107 test_drawBitmap(reporter);
108 test_layers(reporter); 108 test_layers(reporter);
109 } 109 }
OLDNEW
« no previous file with comments | « tests/PDFPrimitivesTest.cpp ('k') | tools/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698