diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-30 18:58:24 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-30 18:58:24 +0000 |
commit | 8b0e8ac5f582de80356019406e2975079bf0829d (patch) | |
tree | 9f43589895207dfcf422d41318b371c9540f1ada /gm | |
parent | 5fbccb35eb9e7e8cfa3c6b02026206db77990324 (diff) |
Refactor read and write buffers.
Eliminates SkFlattenable{Read,Write}Buffer, promoting SkOrdered{Read,Write}Buffer
a step each in the hierarchy.
What used to be this:
SkFlattenableWriteBuffer -> SkOrderedWriteBuffer
SkFlattenableReadBuffer -> SkOrderedReadBuffer
SkFlattenableReadBuffer -> SkValidatingReadBuffer
is now
SkWriteBuffer
SkReadBuffer -> SkValidatingReadBuffer
Benefits:
- code is simpler, names are less wordy
- the generic SkFlattenableFooBuffer code in SkPaint was incorrect; removed
- write buffers are completely devirtualized, important for record speed
This refactoring was mostly mechanical. You aren't going to find anything
interesting in files with less than 10 lines changed.
BUG=skia:
R=reed@google.com, scroggo@google.com, djsollen@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/134163010
git-svn-id: http://skia.googlecode.com/svn/trunk@13245 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/imagefiltersbase.cpp | 4 | ||||
-rw-r--r-- | gm/imagefiltersgraph.cpp | 7 | ||||
-rw-r--r-- | gm/texteffects.cpp | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp index 528dd19f33..109be6a1e0 100644 --- a/gm/imagefiltersbase.cpp +++ b/gm/imagefiltersbase.cpp @@ -27,7 +27,7 @@ protected: return false; } - FailImageFilter(SkFlattenableReadBuffer& buffer) + FailImageFilter(SkReadBuffer& buffer) : INHERITED(1, buffer) {} private: @@ -51,7 +51,7 @@ protected: return true; } - IdentityImageFilter(SkFlattenableReadBuffer& buffer) + IdentityImageFilter(SkReadBuffer& buffer) : INHERITED(1, buffer) {} private: diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp index f5eaa28b13..40b673cb42 100644 --- a/gm/imagefiltersgraph.cpp +++ b/gm/imagefiltersgraph.cpp @@ -13,7 +13,8 @@ #include "SkColorFilter.h" #include "SkColorFilterImageFilter.h" #include "SkColorMatrixFilter.h" -#include "SkFlattenableBuffers.h" +#include "SkReadBuffer.h" +#include "SkWriteBuffer.h" #include "SkMergeImageFilter.h" #include "SkMorphologyImageFilter.h" #include "SkOnce.h" @@ -57,13 +58,13 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SimpleOffsetFilter); protected: - explicit SimpleOffsetFilter(SkFlattenableReadBuffer& buffer) + explicit SimpleOffsetFilter(SkReadBuffer& buffer) : SkImageFilter(1, buffer) { fDX = buffer.readScalar(); fDY = buffer.readScalar(); } - virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE { + virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { this->SkImageFilter::flatten(buffer); buffer.writeScalar(fDX); buffer.writeScalar(fDY); diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp index 7964de92dc..094fe7b8a1 100644 --- a/gm/texteffects.cpp +++ b/gm/texteffects.cpp @@ -8,7 +8,8 @@ #include "gm.h" #include "SkBlurMask.h" #include "SkBlurMaskFilter.h" -#include "SkFlattenableBuffers.h" +#include "SkReadBuffer.h" +#include "SkWriteBuffer.h" #include "SkLayerRasterizer.h" static void r0(SkLayerRasterizer* rast, SkPaint& p) { |