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

Side by Side Diff: tests/RecorderTest.cpp

Issue 238353007: initialize bounds in this test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « no previous file | 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 #include "SkRecord.h" 10 #include "SkRecord.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 REPORTER_ASSERT(r, 1 == tally.count<SkRecords::DrawRect>()); 44 REPORTER_ASSERT(r, 1 == tally.count<SkRecords::DrawRect>());
45 } 45 }
46 46
47 // Regression test for leaking refs held by optional arguments. 47 // Regression test for leaking refs held by optional arguments.
48 DEF_TEST(Recorder_RefLeaking, r) { 48 DEF_TEST(Recorder_RefLeaking, r) {
49 // We use SaveLayer to test: 49 // We use SaveLayer to test:
50 // - its SkRect argument is optional and SkRect is POD. Just testing that that works. 50 // - its SkRect argument is optional and SkRect is POD. Just testing that that works.
51 // - its SkPaint argument is optional and SkPaint is not POD. The bug was here. 51 // - its SkPaint argument is optional and SkPaint is not POD. The bug was here.
52 52
53 SkRect bounds; 53 SkRect bounds = SkRect::MakeWH(320, 240);
54 SkPaint paint; 54 SkPaint paint;
55 paint.setShader(SkNEW(SkEmptyShader))->unref(); 55 paint.setShader(SkNEW(SkEmptyShader))->unref();
56 56
57 REPORTER_ASSERT(r, paint.getShader()->unique()); 57 REPORTER_ASSERT(r, paint.getShader()->unique());
58 { 58 {
59 SkRecord record; 59 SkRecord record;
60 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, 1920, 1080); 60 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, 1920, 1080);
61 recorder.saveLayer(&bounds, &paint); 61 recorder.saveLayer(&bounds, &paint);
62 REPORTER_ASSERT(r, !paint.getShader()->unique()); 62 REPORTER_ASSERT(r, !paint.getShader()->unique());
63 } 63 }
64 REPORTER_ASSERT(r, paint.getShader()->unique()); 64 REPORTER_ASSERT(r, paint.getShader()->unique());
65 } 65 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698