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

Side by Side Diff: tests/RecordingXfermodeTest.cpp

Issue 745383003: add some debugging to SkNVRefCnt (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix bench Created 6 years 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/PictureTest.cpp ('k') | tools/filtermain.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 9
10 #include "../include/core/SkCanvas.h" 10 #include "../include/core/SkCanvas.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 const SkRect& intoClip, 108 const SkRect& intoClip,
109 SkXfermode::Mode mode) { 109 SkXfermode::Mode mode) {
110 SkTileGridFactory::TileGridInfo tileGridInfo = { {100,100}, {0,0}, {0,0} }; 110 SkTileGridFactory::TileGridInfo tileGridInfo = { {100,100}, {0,0}, {0,0} };
111 SkTileGridFactory factory(tileGridInfo); 111 SkTileGridFactory factory(tileGridInfo);
112 SkPictureRecorder recorder; 112 SkPictureRecorder recorder;
113 SkRect canvasRect(SkRect::MakeWH(SkIntToScalar(fWidth),SkIntToScalar(fHe ight))); 113 SkRect canvasRect(SkRect::MakeWH(SkIntToScalar(fWidth),SkIntToScalar(fHe ight)));
114 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(fWidth), 114 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(fWidth),
115 SkIntToScalar(fHeight), 115 SkIntToScalar(fHeight),
116 &factory); 116 &factory);
117 drawer.draw(canvas, canvasRect, mode); 117 drawer.draw(canvas, canvasRect, mode);
118 SkAutoTDelete<SkPicture> picture(recorder.endRecording()); 118 SkAutoTUnref<SkPicture> picture(recorder.endRecording());
119 119
120 SkCanvas replayCanvas(fBitmap); 120 SkCanvas replayCanvas(fBitmap);
121 replayCanvas.clear(0xffffffff); 121 replayCanvas.clear(0xffffffff);
122 replayCanvas.clipRect(intoClip); 122 replayCanvas.clipRect(intoClip);
123 picture->playback(&replayCanvas); 123 picture->playback(&replayCanvas);
124 return fBitmap; 124 return fBitmap;
125 } 125 }
126 126
127 private: 127 private:
128 SkBitmap fBitmap; 128 SkBitmap fBitmap;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 errors.appendf("For SkXfermode %d %s: SkPictureRecorder bitmap is wrong\n", 165 errors.appendf("For SkXfermode %d %s: SkPictureRecorder bitmap is wrong\n",
166 iMode, SkXfermode::ModeName(mode)); 166 iMode, SkXfermode::ModeName(mode));
167 } 167 }
168 #endif 168 #endif
169 } 169 }
170 170
171 #if !FINEGRAIN 171 #if !FINEGRAIN
172 REPORTER_ASSERT_MESSAGE(reporter, 0 == numErrors, errors.c_str()); 172 REPORTER_ASSERT_MESSAGE(reporter, 0 == numErrors, errors.c_str());
173 #endif 173 #endif
174 } 174 }
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tools/filtermain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698