Commit f490d8c1 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by Gerrit Code Review
Browse files

Merge "Tweaks for forward compatibility"

parents 7cd90d4e d25650fd
......@@ -405,6 +405,7 @@ public:
intersect with the canvas' clip
*/
bool quickReject(const SkRect& rect, EdgeType et) const;
bool quickReject(const SkRect& rect) const { return false; }
/** Return true if the specified path, after being transformed by the
current matrix, would lie completely outside of the current clip. Call
......@@ -418,6 +419,7 @@ public:
intersect with the canvas' clip
*/
bool quickReject(const SkPath& path, EdgeType et) const;
bool quickReject(const SkPath& path) const { return false; }
/** Return true if the horizontal band specified by top and bottom is
completely clipped out. This is a conservative calculation, meaning
......@@ -646,6 +648,8 @@ public:
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint = NULL);
virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint*) {}
/** Draw the specified bitmap, with the specified matrix applied (before the
canvas' matrix is applied).
@param bitmap The bitmap to be drawn
......
......@@ -37,7 +37,7 @@ public:
* Called with the paint that will be used to draw the specified type.
* The implementation may modify the paint as they wish.
*/
virtual void filter(SkPaint*, Type) = 0;
virtual bool filter(SkPaint*, Type) = 0;
};
#endif
......@@ -504,6 +504,7 @@ public:
};
// return the number of bytes written, whether or not buffer is null
uint32_t flatten(void* buffer) const;
uint32_t writeToMemory(void*) const { return 0; }
// return the number of bytes read
uint32_t unflatten(const void* buffer);
......
......@@ -352,6 +352,7 @@ public:
* If buffer is NULL, it still returns the number of bytes.
*/
uint32_t flatten(void* buffer) const;
uint32_t writeToMemory(void* buffer) const { return 0; }
/**
* Initialized the region from the buffer, returning the number
......
......@@ -17,7 +17,7 @@ public:
SkPaintFlagsDrawFilter(uint32_t clearFlags, uint32_t setFlags);
// overrides
virtual void filter(SkPaint*, Type);
virtual bool filter(SkPaint*, Type);
private:
uint32_t fPrevFlags; // local cache for filter/restore
......
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkOrderedReadBuffer_DEFINED
#define SkOrderedReadBuffer_DEFINED
class SkFlattenableReadBuffer {
public:
};
class SkOrderedReadBuffer : public SkFlattenableReadBuffer {
public:
SkOrderedReadBuffer(const void*, size_t) {}
};
#endif // SkOrderedReadBuffer_DEFINED
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkOrderedWriteBuffer_DEFINED
#define SkOrderedWriteBuffer_DEFINED
class SkFlattenableWriteBuffer {
public:
enum { kCrossProcess_Flag };
};
class SkOrderedWriteBuffer : public SkFlattenableWriteBuffer {
public:
SkOrderedWriteBuffer(size_t) {}
virtual ~SkOrderedWriteBuffer() {}
uint32_t size() { return 0; }
virtual bool writeToStream(void*) { return false; }
void setFlags(uint32_t) {}
};
#endif // SkOrderedWriteBuffer_DEFINED
......@@ -16,7 +16,8 @@ SkPaintFlagsDrawFilter::SkPaintFlagsDrawFilter(uint32_t clearFlags,
fSetFlags = SkToU16(setFlags & SkPaint::kAllFlags);
}
void SkPaintFlagsDrawFilter::filter(SkPaint* paint, Type) {
bool SkPaintFlagsDrawFilter::filter(SkPaint* paint, Type) {
paint->setFlags((paint->getFlags() & ~fClearFlags) | fSetFlags);
return false;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment