diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-03-06 15:04:58 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2013-03-06 15:04:58 -0800 |
commit | d25650fdfba0c886d1929e291e5df899146a45f6 (patch) | |
tree | ab600697f057f28663d4a28325883ca1a7499070 | |
parent | 7cd90d4eecdba0f40a36945749d40df95d6d641b (diff) | |
download | skia-d25650fdfba0c886d1929e291e5df899146a45f6.tar.gz |
Tweaks for forward compatibility
Change-Id: I136fcbbc14072ee5f5281d09445f28d083ed3ce1
-rw-r--r-- | include/core/SkCanvas.h | 4 | ||||
-rw-r--r-- | include/core/SkDrawFilter.h | 2 | ||||
-rw-r--r-- | include/core/SkMatrix.h | 1 | ||||
-rw-r--r-- | include/core/SkRegion.h | 1 | ||||
-rw-r--r-- | include/effects/SkPaintFlagsDrawFilter.h | 2 | ||||
-rw-r--r-- | src/core/SkMathPriv.h | 0 | ||||
-rw-r--r-- | src/core/SkOrderedReadBuffer.h | 20 | ||||
-rw-r--r-- | src/core/SkOrderedWriteBuffer.h | 25 | ||||
-rw-r--r-- | src/effects/SkPaintFlagsDrawFilter.cpp | 3 |
9 files changed, 55 insertions, 3 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 1b9f0558ba..76c6c884fb 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -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 diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h index 303b80ed80..9bc7b0d5bc 100644 --- a/include/core/SkDrawFilter.h +++ b/include/core/SkDrawFilter.h @@ -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 diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h index 8fdb8185b0..a59b68cbd7 100644 --- a/include/core/SkMatrix.h +++ b/include/core/SkMatrix.h @@ -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); diff --git a/include/core/SkRegion.h b/include/core/SkRegion.h index 7623b82262..a0762df6b4 100644 --- a/include/core/SkRegion.h +++ b/include/core/SkRegion.h @@ -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 diff --git a/include/effects/SkPaintFlagsDrawFilter.h b/include/effects/SkPaintFlagsDrawFilter.h index 66a43cc75a..1d0a2fafde 100644 --- a/include/effects/SkPaintFlagsDrawFilter.h +++ b/include/effects/SkPaintFlagsDrawFilter.h @@ -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 diff --git a/src/core/SkMathPriv.h b/src/core/SkMathPriv.h new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/core/SkMathPriv.h diff --git a/src/core/SkOrderedReadBuffer.h b/src/core/SkOrderedReadBuffer.h new file mode 100644 index 0000000000..15fb0f9fc6 --- /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 0000000000..83e8e4ae49 --- /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 1fe440208c..f15145d43e 100644 --- a/src/effects/SkPaintFlagsDrawFilter.cpp +++ b/src/effects/SkPaintFlagsDrawFilter.cpp @@ -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; } |