diff options
author | 2012-08-07 15:54:32 +0000 | |
---|---|---|
committer | 2012-08-07 15:54:32 +0000 | |
commit | c73dd5c6880739f26216f198c757028fd28df1a4 (patch) | |
tree | 17a4984fe2caecb5d36a27324eaa698550d4db04 /src/effects/SkEmbossMaskFilter.cpp | |
parent | 7b4531f64cbd85d32a77ceab1bdec8335c5a7864 (diff) |
Update SkFlattenable buffers to be more modular.
This CL is an effort to stage the conversion to named
parameters for all SkFlattenable commands. This particular
stage only does the following two things...
1. Move flattenable buffers from SkFlattenable.h into
their own header.
2. Update and Add new read write methods for better clarity
and convenience.
BUG=
Review URL: https://codereview.appspot.com/6448095
git-svn-id: http://skia.googlecode.com/svn/trunk@4980 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/SkEmbossMaskFilter.cpp')
-rw-r--r-- | src/effects/SkEmbossMaskFilter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp index 9ecba340c7..ebc3addd19 100644 --- a/src/effects/SkEmbossMaskFilter.cpp +++ b/src/effects/SkEmbossMaskFilter.cpp @@ -12,6 +12,7 @@ #include "SkBlurMask.h" #include "SkEmbossMask.h" #include "SkBuffer.h" +#include "SkFlattenableBuffers.h" static inline int pin2byte(int n) { if (n < 0) { @@ -117,7 +118,8 @@ bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src, SkEmbossMaskFilter::SkEmbossMaskFilter(SkFlattenableReadBuffer& buffer) : SkMaskFilter(buffer) { - buffer.read(&fLight, sizeof(fLight)); + SkASSERT(buffer.getArrayCount() == sizeof(Light)); + buffer.readByteArray(&fLight); SkASSERT(fLight.fPad == 0); // for the font-cache lookup to be clean fBlurRadius = buffer.readScalar(); } @@ -127,7 +129,7 @@ void SkEmbossMaskFilter::flatten(SkFlattenableWriteBuffer& buffer) const { Light tmpLight = fLight; tmpLight.fPad = 0; // for the font-cache lookup to be clean - buffer.writeMul4(&tmpLight, sizeof(tmpLight)); + buffer.writeByteArray(&tmpLight, sizeof(tmpLight)); buffer.writeScalar(fBlurRadius); } |