#include "SkMatrixConvolutionImageFilter.h"
#include "SkBitmap.h"
#include "SkColorPriv.h"
-#include "SkFlattenableBuffers.h"
+#include "SkReadBuffer.h"
+#include "SkWriteBuffer.h"
#include "SkRect.h"
#include "SkUnPreMultiply.h"
SkASSERT(target.fY >= 0 && target.fY < kernelSize.fHeight);
}
-SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(SkFlattenableReadBuffer& buffer)
+SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(SkReadBuffer& buffer)
: INHERITED(1, buffer) {
// We need to be able to read at most SK_MaxS32 bytes, so divide that
// by the size of a scalar to know how many scalars we can read.
tile_mode_is_valid(fTileMode));
}
-void SkMatrixConvolutionImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
+void SkMatrixConvolutionImageFilter::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
buffer.writeInt(fKernelSize.fWidth);
buffer.writeInt(fKernelSize.fHeight);
void SkMatrixConvolutionImageFilter::filterPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
for (int y = rect.fTop; y < rect.fBottom; ++y) {
SkPMColor* dptr = result->getAddr32(rect.fLeft - bounds.fLeft, y - bounds.fTop);
for (int x = rect.fLeft; x < rect.fRight; ++x) {
void SkMatrixConvolutionImageFilter::filterPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
if (fConvolveAlpha) {
filterPixels<PixelFetcher, true>(src, result, rect, bounds);
} else {
void SkMatrixConvolutionImageFilter::filterInteriorPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
filterPixels<UncheckedPixelFetcher>(src, result, rect, bounds);
}
void SkMatrixConvolutionImageFilter::filterBorderPixels(const SkBitmap& src,
SkBitmap* result,
const SkIRect& rect,
- const SkIRect& bounds) {
+ const SkIRect& bounds) const {
switch (fTileMode) {
case kClamp_TileMode:
filterPixels<ClampPixelFetcher>(src, result, rect, bounds);
const SkBitmap& source,
const SkMatrix& matrix,
SkBitmap* result,
- SkIPoint* offset) {
+ SkIPoint* offset) const {
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &srcOffset)) {