diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-21 18:46:30 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-21 18:46:30 +0000 |
commit | 727a352f7412753d2a3e4d30eab6500a1a4de135 (patch) | |
tree | ca4bee87d3a35d583ddae5d90f1b123e0f18b036 /gm/colormatrix.cpp | |
parent | a3baf3be0e2a3128fb73bd41d40d130f75a4dc86 (diff) |
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
Diffstat (limited to 'gm/colormatrix.cpp')
-rw-r--r-- | gm/colormatrix.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gm/colormatrix.cpp b/gm/colormatrix.cpp index e0dcfaf72e..862bdf9d51 100644 --- a/gm/colormatrix.cpp +++ b/gm/colormatrix.cpp @@ -29,11 +29,11 @@ private: }; static void setColorMatrix(SkPaint* paint, const SkColorMatrix& matrix) { - paint->setColorFilter(SkNEW_ARGS(SkColorMatrixFilter, (matrix)))->unref(); + paint->setColorFilter(SkColorMatrixFilter::Create(matrix))->unref(); } static void setArray(SkPaint* paint, const SkScalar array[]) { - paint->setColorFilter(SkNEW_ARGS(SkColorMatrixFilter, (array)))->unref(); + paint->setColorFilter(SkColorMatrixFilter::Create(array))->unref(); } namespace skiagm { |