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

Side by Side Diff: tests/PDFPrimitivesTest.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/LayerRasterizerTest.cpp ('k') | tests/QuickRejectTest.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 2010 The Android Open Source Project 2 * Copyright 2010 The Android Open Source Project
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 "Resources.h" 8 #include "Resources.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 return true; 374 return true;
375 } 375 }
376 SK_TO_STRING_OVERRIDE() 376 SK_TO_STRING_OVERRIDE()
377 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter) 377 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter)
378 bool visited() const { return fVisited; } 378 bool visited() const { return fVisited; }
379 379
380 private: 380 private:
381 mutable bool fVisited; 381 mutable bool fVisited;
382 }; 382 };
383 383
384 SkFlattenable* DummyImageFilter::CreateProc(SkReadBuffer& buffer) { 384 sk_sp<SkFlattenable> DummyImageFilter::CreateProc(SkReadBuffer& buffer) {
385 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); 385 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0);
386 bool visited = buffer.readBool(); 386 bool visited = buffer.readBool();
387 return new DummyImageFilter(visited); 387 return sk_make_sp<DummyImageFilter>(visited);
388 } 388 }
389 389
390 #ifndef SK_IGNORE_TO_STRING 390 #ifndef SK_IGNORE_TO_STRING
391 void DummyImageFilter::toString(SkString* str) const { 391 void DummyImageFilter::toString(SkString* str) const {
392 str->appendf("DummyImageFilter: ("); 392 str->appendf("DummyImageFilter: (");
393 str->append(")"); 393 str->append(")");
394 } 394 }
395 #endif 395 #endif
396 396
397 }; 397 };
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 float alwaysCheck[] = { 474 float alwaysCheck[] = {
475 0.0f, -0.0f, 1.0f, -1.0f, SK_ScalarPI, 0.1f, FLT_MIN, FLT_MAX, 475 0.0f, -0.0f, 1.0f, -1.0f, SK_ScalarPI, 0.1f, FLT_MIN, FLT_MAX,
476 -FLT_MIN, -FLT_MAX, FLT_MIN / 16.0f, -FLT_MIN / 16.0f, 476 -FLT_MIN, -FLT_MAX, FLT_MIN / 16.0f, -FLT_MIN / 16.0f,
477 SK_FloatNaN, SK_FloatInfinity, SK_FloatNegativeInfinity, 477 SK_FloatNaN, SK_FloatInfinity, SK_FloatNegativeInfinity,
478 -FLT_MIN / 8388608.0 478 -FLT_MIN / 8388608.0
479 }; 479 };
480 for (float inputFloat: alwaysCheck) { 480 for (float inputFloat: alwaysCheck) {
481 check_pdf_scalar_serialization(reporter, inputFloat); 481 check_pdf_scalar_serialization(reporter, inputFloat);
482 } 482 }
483 } 483 }
OLDNEW
« no previous file with comments | « tests/LayerRasterizerTest.cpp ('k') | tests/QuickRejectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698