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

Side by Side Diff: tests/RecordDrawTest.cpp

Issue 829983003: Rename SkDrawPictureCallback to SkPicture::AbortCallback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Readd deleted android gypi changes 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/gpu/GrRecordReplaceDraw.cpp ('k') | tests/RecordReplaceDrawTest.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 "Test.h" 8 #include "Test.h"
9 #include "RecordTestUtils.h" 9 #include "RecordTestUtils.h"
10 10
11 #include "SkDebugCanvas.h" 11 #include "SkDebugCanvas.h"
12 #include "SkDrawPictureCallback.h"
13 #include "SkDropShadowImageFilter.h" 12 #include "SkDropShadowImageFilter.h"
14 #include "SkImagePriv.h" 13 #include "SkImagePriv.h"
15 #include "SkRecord.h" 14 #include "SkRecord.h"
16 #include "SkRecordDraw.h" 15 #include "SkRecordDraw.h"
17 #include "SkRecordOpts.h" 16 #include "SkRecordOpts.h"
18 #include "SkRecorder.h" 17 #include "SkRecorder.h"
19 #include "SkRecords.h" 18 #include "SkRecords.h"
20 #include "SkSurface.h" 19 #include "SkSurface.h"
21 20
22 static const int W = 1920, H = 1080; 21 static const int W = 1920, H = 1080;
23 22
24 class JustOneDraw : public SkDrawPictureCallback { 23 class JustOneDraw : public SkPicture::AbortCallback {
25 public: 24 public:
26 JustOneDraw() : fCalls(0) {} 25 JustOneDraw() : fCalls(0) {}
27 26
28 virtual bool abortDrawing() SK_OVERRIDE { return fCalls++ > 0; } 27 virtual bool abort() SK_OVERRIDE { return fCalls++ > 0; }
29 private: 28 private:
30 int fCalls; 29 int fCalls;
31 }; 30 };
32 31
33 DEF_TEST(RecordDraw_LazySaves, r) { 32 DEF_TEST(RecordDraw_LazySaves, r) {
34 // Record two commands. 33 // Record two commands.
35 SkRecord record; 34 SkRecord record;
36 SkRecorder recorder(&record, W, H); 35 SkRecorder recorder(&record, W, H);
37 36
38 REPORTER_ASSERT(r, 0 == record.count()); 37 REPORTER_ASSERT(r, 0 == record.count());
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 323
325 { 324 {
326 SkRecord record; 325 SkRecord record;
327 SkRecorder recorder(&record, 10, 10); 326 SkRecorder recorder(&record, 10, 10);
328 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10)); 327 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10));
329 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0); 328 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0);
330 } 329 }
331 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); 330 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled);
332 331
333 } 332 }
OLDNEW
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.cpp ('k') | tests/RecordReplaceDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698