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

Side by Side Diff: tests/PaintTest.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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') | tests/PathOpsAngleIdeas.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 "SkBlurMask.h" 8 #include "SkBlurMask.h"
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkLayerDrawLooper.h" 10 #include "SkLayerDrawLooper.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 288
289 #define ASSERT(expr) REPORTER_ASSERT(r, expr) 289 #define ASSERT(expr) REPORTER_ASSERT(r, expr)
290 290
291 DEF_TEST(Paint_MoreFlattening, r) { 291 DEF_TEST(Paint_MoreFlattening, r) {
292 SkPaint paint; 292 SkPaint paint;
293 paint.setColor(0x00AABBCC); 293 paint.setColor(0x00AABBCC);
294 paint.setTextScaleX(1.0f); // Default value, ignored. 294 paint.setTextScaleX(1.0f); // Default value, ignored.
295 paint.setTextSize(19); 295 paint.setTextSize(19);
296 paint.setXfermode(SkXfermode::Create(SkXfermode::kModulate_Mode))->unref(); 296 paint.setXfermode(SkXfermode::Create(SkXfermode::kModulate_Mode))->unref();
297 paint.setLooper(NULL); // Default value, ignored. 297 paint.setLooper(nullptr); // Default value, ignored.
298 298
299 SkWriteBuffer writer; 299 SkWriteBuffer writer;
300 paint.flatten(writer); 300 paint.flatten(writer);
301 301
302 SkReadBuffer reader(writer.getWriter32()->contiguousArray(), writer.bytesWri tten()); 302 SkReadBuffer reader(writer.getWriter32()->contiguousArray(), writer.bytesWri tten());
303 SkPaint other; 303 SkPaint other;
304 other.unflatten(reader); 304 other.unflatten(reader);
305 ASSERT(reader.offset() == writer.bytesWritten()); 305 ASSERT(reader.offset() == writer.bytesWritten());
306 306
307 // No matter the encoding, these must always hold. 307 // No matter the encoding, these must always hold.
(...skipping 18 matching lines...) Expand all
326 326
327 // Check that some arbitrary field affects the hash. 327 // Check that some arbitrary field affects the hash.
328 paint.setColor(0xFF00FF00); 328 paint.setColor(0xFF00FF00);
329 REPORTER_ASSERT(r, paint.getHash() != defaultHash); 329 REPORTER_ASSERT(r, paint.getHash() != defaultHash);
330 paint.setColor(SK_ColorBLACK); // Reset to default value. 330 paint.setColor(SK_ColorBLACK); // Reset to default value.
331 REPORTER_ASSERT(r, paint.getHash() == defaultHash); 331 REPORTER_ASSERT(r, paint.getHash() == defaultHash);
332 332
333 // SkTypeface is the first field we hash, so test it specially. 333 // SkTypeface is the first field we hash, so test it specially.
334 paint.setTypeface(SkTypeface::RefDefault())->unref(); 334 paint.setTypeface(SkTypeface::RefDefault())->unref();
335 REPORTER_ASSERT(r, paint.getHash() != defaultHash); 335 REPORTER_ASSERT(r, paint.getHash() != defaultHash);
336 paint.setTypeface(NULL); 336 paint.setTypeface(nullptr);
337 REPORTER_ASSERT(r, paint.getHash() == defaultHash); 337 REPORTER_ASSERT(r, paint.getHash() == defaultHash);
338 338
339 // This is part of fBitfields, the last field we hash. 339 // This is part of fBitfields, the last field we hash.
340 paint.setHinting(SkPaint::kSlight_Hinting); 340 paint.setHinting(SkPaint::kSlight_Hinting);
341 REPORTER_ASSERT(r, paint.getHash() != defaultHash); 341 REPORTER_ASSERT(r, paint.getHash() != defaultHash);
342 paint.setHinting(SkPaint::kNormal_Hinting); 342 paint.setHinting(SkPaint::kNormal_Hinting);
343 REPORTER_ASSERT(r, paint.getHash() == defaultHash); 343 REPORTER_ASSERT(r, paint.getHash() == defaultHash);
344 } 344 }
345 345
346 #include "SkColorMatrixFilter.h" 346 #include "SkColorMatrixFilter.h"
(...skipping 15 matching lines...) Expand all
362 SkColorMatrix cm; 362 SkColorMatrix cm;
363 cm.setIdentity(); // does not change alpha 363 cm.setIdentity(); // does not change alpha
364 paint.setColorFilter(SkColorMatrixFilter::Create(cm))->unref(); 364 paint.setColorFilter(SkColorMatrixFilter::Create(cm))->unref();
365 REPORTER_ASSERT(r, paint.nothingToDraw()); 365 REPORTER_ASSERT(r, paint.nothingToDraw());
366 366
367 cm.postTranslate(0, 0, 0, 1); // wacks alpha 367 cm.postTranslate(0, 0, 0, 1); // wacks alpha
368 paint.setColorFilter(SkColorMatrixFilter::Create(cm))->unref(); 368 paint.setColorFilter(SkColorMatrixFilter::Create(cm))->unref();
369 REPORTER_ASSERT(r, !paint.nothingToDraw()); 369 REPORTER_ASSERT(r, !paint.nothingToDraw());
370 } 370 }
371 371
OLDNEW
« no previous file with comments | « tests/PDFPrimitivesTest.cpp ('k') | tests/PathOpsAngleIdeas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698