Skia
2D Graphics Library
SkOverdrawCanvas.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkOverdrawCanvas_DEFINED
9 #define SkOverdrawCanvas_DEFINED
10 
12 #include "include/utils/SkNWayCanvas.h"
13 
19 class SK_API SkOverdrawCanvas : public SkCanvasVirtualEnforcer<SkNWayCanvas> {
20 public:
21  /* Does not take ownership of canvas */
23 
24  void onDrawTextBlob(const SkTextBlob*, SkScalar, SkScalar, const SkPaint&) override;
25  void onDrawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], SkBlendMode,
26  const SkPaint&) override;
27  void onDrawPaint(const SkPaint&) override;
28  void onDrawBehind(const SkPaint& paint) override;
29  void onDrawRect(const SkRect&, const SkPaint&) override;
30  void onDrawRegion(const SkRegion&, const SkPaint&) override;
31  void onDrawOval(const SkRect&, const SkPaint&) override;
32  void onDrawArc(const SkRect&, SkScalar, SkScalar, bool, const SkPaint&) override;
33  void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
34  void onDrawRRect(const SkRRect&, const SkPaint&) override;
35  void onDrawPoints(PointMode, size_t, const SkPoint[], const SkPaint&) override;
36  void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override;
37  void onDrawPath(const SkPath&, const SkPaint&) override;
38 
40  const SkPaint*) override;
41  void onDrawImageRect2(const SkImage*, const SkRect&, const SkRect&, const SkSamplingOptions&,
42  const SkPaint*, SrcRectConstraint) override;
43  void onDrawImageLattice2(const SkImage*, const Lattice&, const SkRect&, SkFilterMode,
44  const SkPaint*) override;
45  void onDrawAtlas2(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
46  SkBlendMode, const SkSamplingOptions&, const SkRect*, const SkPaint*) override;
47 
48  void onDrawDrawable(SkDrawable*, const SkMatrix*) override;
49  void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
50 
51  void onDrawAnnotation(const SkRect&, const char key[], SkData* value) override;
52  void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override;
53 
55  SkBlendMode) override;
56  void onDrawEdgeAAImageSet2(const ImageSetEntry[], int count, const SkPoint[], const SkMatrix[],
57  const SkSamplingOptions&,const SkPaint*, SrcRectConstraint) override;
58 
59 private:
60  void drawPosTextCommon(const SkGlyphID[], int, const SkScalar[], int, const SkPoint&,
61  const SkFont&, const SkPaint&);
62 
63  inline SkPaint overdrawPaint(const SkPaint& paint);
64 
65  SkPaint fPaint;
66 
68 };
69 
70 #endif
SkGlyphID
uint16_t SkGlyphID
16 bit unsigned integer to hold a glyph index
Definition: SkTypes.h:556
SkTextBlob
Definition: SkTextBlob.h:28
SkImage
Definition: SkImage.h:61
SkPath
Definition: SkPath.h:44
SkOverdrawCanvas::onDrawImageLattice2
void onDrawImageLattice2(const SkImage *, const Lattice &, const SkRect &, SkFilterMode, const SkPaint *) override
SkRSXform
A compressed form of a rotation+scale matrix.
Definition: SkRSXform.h:21
SkOverdrawCanvas::onDrawDRRect
void onDrawDRRect(const SkRRect &, const SkRRect &, const SkPaint &) override
SkColor4f
SkBlendMode
SkBlendMode
Blends are operators that take in two colors (source, destination) and return a new color.
Definition: SkBlendMode.h:38
SkOverdrawCanvas::onDrawRect
void onDrawRect(const SkRect &, const SkPaint &) override
SkCanvasVirtualEnforcer
Definition: SkCanvasVirtualEnforcer.h:17
SkOverdrawCanvas::SkOverdrawCanvas
SkOverdrawCanvas(SkCanvas *)
SkData
SkData holds an immutable data buffer.
Definition: SkData.h:22
SkOverdrawCanvas::onDrawPatch
void onDrawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], SkBlendMode, const SkPaint &) override
SkRRect
Definition: SkRRect.h:31
SkFilterMode
SkFilterMode
Definition: SkSamplingOptions.h:14
SkOverdrawCanvas::onDrawBehind
void onDrawBehind(const SkPaint &paint) override
SkSamplingOptions
Definition: SkSamplingOptions.h:54
SkVertices
An immutable set of vertex data that can be used with SkCanvas::drawVertices.
Definition: SkVertices.h:22
SkRegion
Definition: SkRegion.h:23
SkPoint
Definition: SkPoint.h:160
SkOverdrawCanvas::onDrawEdgeAAQuad
void onDrawEdgeAAQuad(const SkRect &, const SkPoint[4], SkCanvas::QuadAAFlags, const SkColor4f &, SkBlendMode) override
SkPaint
Definition: SkPaint.h:39
SkCanvasVirtualEnforcer.h
SK_API
#define SK_API
Definition: SkTypes.h:181
SkOverdrawCanvas::onDrawPoints
void onDrawPoints(PointMode, size_t, const SkPoint[], const SkPaint &) override
SkOverdrawCanvas::onDrawRRect
void onDrawRRect(const SkRRect &, const SkPaint &) override
SkOverdrawCanvas::onDrawPath
void onDrawPath(const SkPath &, const SkPaint &) override
SkOverdrawCanvas::onDrawOval
void onDrawOval(const SkRect &, const SkPaint &) override
SkCanvas
Definition: SkCanvas.h:87
SkPicture
Definition: SkPicture.h:39
SkOverdrawCanvas::onDrawImage2
void onDrawImage2(const SkImage *, SkScalar, SkScalar, const SkSamplingOptions &, const SkPaint *) override
SkDrawable
Base-class for objects that draw into SkCanvas.
Definition: SkDrawable.h:29
SkOverdrawCanvas
Captures all drawing commands.
Definition: SkOverdrawCanvas.h:19
SkScalar
float SkScalar
Definition: SkScalar.h:16
SkOverdrawCanvas::onDrawVerticesObject
void onDrawVerticesObject(const SkVertices *, SkBlendMode, const SkPaint &) override
SkOverdrawCanvas::onDrawArc
void onDrawArc(const SkRect &, SkScalar, SkScalar, bool, const SkPaint &) override
SkOverdrawCanvas::onDrawPaint
void onDrawPaint(const SkPaint &) override
SkOverdrawCanvas::onDrawRegion
void onDrawRegion(const SkRegion &, const SkPaint &) override
SkOverdrawCanvas::onDrawAnnotation
void onDrawAnnotation(const SkRect &, const char key[], SkData *value) override
SkMatrix
Definition: SkMatrix.h:48
SkFont
Definition: SkFont.h:23
SkOverdrawCanvas::onDrawAtlas2
void onDrawAtlas2(const SkImage *, const SkRSXform[], const SkRect[], const SkColor[], int, SkBlendMode, const SkSamplingOptions &, const SkRect *, const SkPaint *) override
SkOverdrawCanvas::onDrawPicture
void onDrawPicture(const SkPicture *, const SkMatrix *, const SkPaint *) override
SkColor
uint32_t SkColor
32-bit ARGB color value, unpremultiplied.
Definition: SkColor.h:35
SkRect
Definition: SkRect.h:572
SkOverdrawCanvas::onDrawImageRect2
void onDrawImageRect2(const SkImage *, const SkRect &, const SkRect &, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
SkCanvas::QuadAAFlags
QuadAAFlags
Experimental.
Definition: SkCanvas.h:1566
SkOverdrawCanvas::onDrawEdgeAAImageSet2
void onDrawEdgeAAImageSet2(const ImageSetEntry[], int count, const SkPoint[], const SkMatrix[], const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
SkOverdrawCanvas::onDrawTextBlob
void onDrawTextBlob(const SkTextBlob *, SkScalar, SkScalar, const SkPaint &) override
SkOverdrawCanvas::onDrawDrawable
void onDrawDrawable(SkDrawable *, const SkMatrix *) override
SkOverdrawCanvas::onDrawShadowRec
void onDrawShadowRec(const SkPath &, const SkDrawShadowRec &) override