From 727a352f7412753d2a3e4d30eab6500a1a4de135 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Fri, 21 Feb 2014 18:46:30 +0000 Subject: Factory methods for heap-allocated SkColorFilter objects. This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkColorFilter and its subclasses non-public and instead provides factory methods for creating these objects on the heap. We temporarily keep constructor of publicly visible classes public behind a flag. BUG=skia:2187 R=scroggo@google.com, mtklein@google.com, reed@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/175293002 git-svn-id: http://skia.googlecode.com/svn/trunk@13539 2bbb7eff-a529-9590-31e7-b0007b416f81 --- bench/ColorFilterBench.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bench/ColorFilterBench.cpp') diff --git a/bench/ColorFilterBench.cpp b/bench/ColorFilterBench.cpp index 9fec587b5c..3d9515477c 100644 --- a/bench/ColorFilterBench.cpp +++ b/bench/ColorFilterBench.cpp @@ -33,7 +33,7 @@ protected: 0, 1, 0, 0, amount255, 0, 0, 1, 0, amount255, 0, 0, 0, 1, 0 }; - SkAutoTUnref filter(new SkColorMatrixFilter(matrix)); + SkAutoTUnref filter(SkColorMatrixFilter::Create(matrix)); return SkColorFilterImageFilter::Create(filter, input); } @@ -44,7 +44,7 @@ protected: matrix[1] = matrix[6] = matrix[11] = 0.7152f; matrix[2] = matrix[7] = matrix[12] = 0.0722f; matrix[18] = 1.0f; - SkAutoTUnref filter(new SkColorMatrixFilter(matrix)); + SkAutoTUnref filter(SkColorMatrixFilter::Create(matrix)); return SkColorFilterImageFilter::Create(filter, input); } -- cgit v1.2.3