Tweaks for forward compatibility
Change-Id: I136fcbbc14072ee5f5281d09445f28d083ed3ce1
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 1b9f055..76c6c88 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -405,6 +405,7 @@
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 @@
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 @@
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
diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h
index 303b80e..9bc7b0d 100644
--- a/include/core/SkDrawFilter.h
+++ b/include/core/SkDrawFilter.h
@@ -37,7 +37,7 @@
* 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
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 8fdb818..a59b68c 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -504,6 +504,7 @@
};
// 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);
diff --git a/include/core/SkRegion.h b/include/core/SkRegion.h
index 7623b82..a0762df 100644
--- a/include/core/SkRegion.h
+++ b/include/core/SkRegion.h
@@ -352,6 +352,7 @@
* 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
diff --git a/include/effects/SkPaintFlagsDrawFilter.h b/include/effects/SkPaintFlagsDrawFilter.h
index 66a43cc..1d0a2fa 100644
--- a/include/effects/SkPaintFlagsDrawFilter.h
+++ b/include/effects/SkPaintFlagsDrawFilter.h
@@ -17,7 +17,7 @@
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
diff --git a/src/core/SkMathPriv.h b/src/core/SkMathPriv.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/core/SkMathPriv.h
diff --git a/src/core/SkOrderedReadBuffer.h b/src/core/SkOrderedReadBuffer.h
new file mode 100644
index 0000000..15fb0f9
--- /dev/null
+++ b/src/core/SkOrderedReadBuffer.h
@@ -0,0 +1,20 @@
+/*
+ * 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
diff --git a/src/core/SkOrderedWriteBuffer.h b/src/core/SkOrderedWriteBuffer.h
new file mode 100644
index 0000000..83e8e4a
--- /dev/null
+++ b/src/core/SkOrderedWriteBuffer.h
@@ -0,0 +1,25 @@
+/*
+ * 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
diff --git a/src/effects/SkPaintFlagsDrawFilter.cpp b/src/effects/SkPaintFlagsDrawFilter.cpp
index 1fe4402..f15145d 100644
--- a/src/effects/SkPaintFlagsDrawFilter.cpp
+++ b/src/effects/SkPaintFlagsDrawFilter.cpp
@@ -16,7 +16,8 @@
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;
}