aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkBounder.h93
-rw-r--r--include/core/SkCanvas.h27
-rw-r--r--include/core/SkDraw.h2
-rw-r--r--include/core/SkMaskFilter.h11
4 files changed, 4 insertions, 129 deletions
diff --git a/include/core/SkBounder.h b/include/core/SkBounder.h
deleted file mode 100644
index 7368d09aa5..0000000000
--- a/include/core/SkBounder.h
+++ /dev/null
@@ -1,93 +0,0 @@
-
-/*
- * Copyright 2006 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-#ifndef SkBounder_DEFINED
-#define SkBounder_DEFINED
-
-#include "SkTypes.h"
-#include "SkRefCnt.h"
-#include "SkPoint.h"
-
-struct SkGlyph;
-struct SkIRect;
-struct SkPoint;
-struct SkRect;
-class SkPaint;
-class SkPath;
-class SkRegion;
-
-/** \class SkBounder
-
- Base class for intercepting the device bounds of shapes before they are drawn.
- Install a subclass of this in your canvas.
-*/
-class SkBounder : public SkRefCnt {
-public:
- SK_DECLARE_INST_COUNT(SkBounder)
-
- SkBounder();
-
- /* Call to perform a clip test before calling onIRect.
- Returns the result from onIRect.
- */
- bool doIRect(const SkIRect&);
- bool doIRectGlyph(const SkIRect& , int x, int y, const SkGlyph&);
-
-protected:
- /** Override in your subclass. This is called with the device bounds of an
- object (text, geometry, image) just before it is drawn. If your method
- returns false, the drawing for that shape is aborted. If your method
- returns true, drawing continues. The bounds your method receives have already
- been transformed in to device coordinates, and clipped to the current clip.
- */
- virtual bool onIRect(const SkIRect&) {
- return false;
- }
-
- /** Passed to onIRectGlyph with the information about the current glyph.
- LSB and RSB are fixed-point (16.16) coordinates of the start and end
- of the glyph's advance
- */
- struct GlyphRec {
- SkIPoint fLSB; //!< fixed-point left-side-bearing of the glyph
- SkIPoint fRSB; //!< fixed-point right-side-bearing of the glyph
- uint16_t fGlyphID;
- uint16_t fFlags; //!< currently set to 0
- };
-
- /** Optionally, override in your subclass to receive the glyph ID when
- text drawing supplies the device bounds of the object.
- */
- virtual bool onIRectGlyph(const SkIRect& r, const GlyphRec&) {
- return onIRect(r);
- }
-
- /** Called after each shape has been drawn. The default implementation does
- nothing, but your override could use this notification to signal itself
- that the offscreen being rendered into needs to be updated to the screen.
- */
- virtual void commit();
-
-private:
- bool doHairline(const SkPoint&, const SkPoint&, const SkPaint&);
- bool doRect(const SkRect&, const SkPaint&);
- bool doPath(const SkPath&, const SkPaint&, bool doFill);
- void setClip(const SkRegion* clip) { fClip = clip; }
-
- const SkRegion* fClip;
- friend class SkAutoBounderCommit;
- friend class SkDraw;
- friend class SkDrawIter;
- friend struct Draw1Glyph;
- friend class SkMaskFilter;
-
- typedef SkRefCnt INHERITED;
-};
-
-#endif
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 6eb42d2f5a..4aaf46b397 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -18,22 +18,12 @@
#include "SkRegion.h"
#include "SkXfermode.h"
-// if not defined, we always assume ClipToLayer for saveLayer()
-//#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
-
-
-//#define SK_SUPPORT_LEGACY_GETCLIPTYPE
-//#define SK_SUPPORT_LEGACY_GETTOTALCLIP
-//#define SK_SUPPORT_LEGACY_GETTOPDEVICE
-
-//#define SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL
#ifdef SK_SUPPORT_LEGACY_DRAWTEXT_VIRTUAL
#define SK_LEGACY_DRAWTEXT_VIRTUAL virtual
#else
#define SK_LEGACY_DRAWTEXT_VIRTUAL
#endif
-class SkBounder;
class SkBaseDevice;
class SkDraw;
class SkDrawFilter;
@@ -1069,22 +1059,6 @@ public:
//////////////////////////////////////////////////////////////////////////
- /** Get the current bounder object.
- The bounder's reference count is unchaged.
- @return the canva's bounder (or NULL).
- */
- SkBounder* getBounder() const { return fBounder; }
-
- /** Set a new bounder (or NULL).
- Pass NULL to clear any previous bounder.
- As a convenience, the parameter passed is also returned.
- If a previous bounder exists, its reference count is decremented.
- If bounder is not NULL, its reference count is incremented.
- @param bounder the new bounder (or NULL) to be installed in the canvas
- @return the set bounder object
- */
- virtual SkBounder* setBounder(SkBounder* bounder);
-
/** Get the current filter object. The filter's reference count is not
affected. The filter is saved/restored, just like the matrix and clip.
@return the canvas' filter (or NULL).
@@ -1304,7 +1278,6 @@ private:
// the first N recs that can fit here mean we won't call malloc
uint32_t fMCRecStorage[32];
- SkBounder* fBounder;
int fSaveLayerCount; // number of successful saveLayer calls
int fCullCount; // number of active culls
diff --git a/include/core/SkDraw.h b/include/core/SkDraw.h
index f0759dc3c5..918f2335ea 100644
--- a/include/core/SkDraw.h
+++ b/include/core/SkDraw.h
@@ -15,7 +15,6 @@
#include "SkPaint.h"
class SkBitmap;
-class SkBounder;
class SkClipStack;
class SkBaseDevice;
class SkMatrix;
@@ -140,7 +139,6 @@ public:
const SkClipStack* fClipStack; // optional
SkBaseDevice* fDevice; // optional
- SkBounder* fBounder; // optional
SkDrawProcs* fProcs; // optional
#ifdef SK_DEBUG
diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h
index 8051e7d831..72f20af21f 100644
--- a/include/core/SkMaskFilter.h
+++ b/include/core/SkMaskFilter.h
@@ -19,7 +19,6 @@ class GrContext;
class GrPaint;
class SkBitmap;
class SkBlitter;
-class SkBounder;
class SkMatrix;
class SkPath;
class SkRasterClip;
@@ -205,17 +204,15 @@ private:
to render that mask. Returns false if filterMask() returned false.
This method is not exported to java.
*/
- bool filterPath(const SkPath& devPath, const SkMatrix& devMatrix,
- const SkRasterClip&, SkBounder*, SkBlitter* blitter,
- SkPaint::Style style) const;
+ bool filterPath(const SkPath& devPath, const SkMatrix& ctm, const SkRasterClip&, SkBlitter*,
+ SkPaint::Style) const;
/** Helper method that, given a roundRect in device space, will rasterize it into a kA8_Format
mask and then call filterMask(). If this returns true, the specified blitter will be called
to render that mask. Returns false if filterMask() returned false.
*/
- bool filterRRect(const SkRRect& devRRect, const SkMatrix& devMatrix,
- const SkRasterClip&, SkBounder*, SkBlitter* blitter,
- SkPaint::Style style) const;
+ bool filterRRect(const SkRRect& devRRect, const SkMatrix& ctm, const SkRasterClip&,
+ SkBlitter*, SkPaint::Style style) const;
typedef SkFlattenable INHERITED;
};