OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, Google Inc. All rights reserved. | 2 * Copyright (c) 2012, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 OpaqueRegionSkia(); | 50 OpaqueRegionSkia(); |
51 | 51 |
52 // The resulting opaque region as a single rect. | 52 // The resulting opaque region as a single rect. |
53 IntRect asRect() const; | 53 IntRect asRect() const; |
54 | 54 |
55 void pushCanvasLayer(const SkPaint*); | 55 void pushCanvasLayer(const SkPaint*); |
56 void popCanvasLayer(const GraphicsContext*); | 56 void popCanvasLayer(const GraphicsContext*); |
57 | 57 |
58 void setImageMask(const SkRect& imageOpaqueRect); | 58 void setImageMask(const SkRect& imageOpaqueRect); |
59 | 59 |
| 60 // Set this to true to track regions that occlude the destination instead of
only regions that produce opaque pixels. |
| 61 void setTreatOverwriteAsOpaque(bool value) { m_treatOverwriteAsOpaque = valu
e; } |
| 62 |
60 enum DrawType { | 63 enum DrawType { |
61 FillOnly, | 64 FillOnly, |
62 FillOrStroke | 65 FillOrStroke |
63 }; | 66 }; |
64 | 67 |
65 void didDrawRect(const GraphicsContext*, const SkRect&, const SkPaint&, cons
t SkBitmap* sourceBitmap); | 68 void didDrawRect(const GraphicsContext*, const SkRect&, const SkPaint&, cons
t SkBitmap* sourceBitmap); |
66 void didDrawPath(const GraphicsContext*, const SkPath&, const SkPaint&); | 69 void didDrawPath(const GraphicsContext*, const SkPath&, const SkPaint&); |
67 void didDrawPoints(const GraphicsContext*, SkCanvas::PointMode, int numPoint
s, const SkPoint[], const SkPaint&); | 70 void didDrawPoints(const GraphicsContext*, SkCanvas::PointMode, int numPoint
s, const SkPoint[], const SkPaint&); |
68 void didDrawBounded(const GraphicsContext*, const SkRect&, const SkPaint&); | 71 void didDrawBounded(const GraphicsContext*, const SkRect&, const SkPaint&); |
69 void didDrawUnbounded(const GraphicsContext*, const SkPaint&, DrawType); | 72 void didDrawUnbounded(const GraphicsContext*, const SkPaint&, DrawType); |
(...skipping 19 matching lines...) Expand all Loading... |
89 private: | 92 private: |
90 void didDraw(const GraphicsContext*, const SkRect&, const SkPaint&, const Sk
Bitmap* sourceBitmap, bool fillsBounds, DrawType); | 93 void didDraw(const GraphicsContext*, const SkRect&, const SkPaint&, const Sk
Bitmap* sourceBitmap, bool fillsBounds, DrawType); |
91 void applyOpaqueRegionFromLayer(const GraphicsContext*, const SkRect& layerO
paqueRect, const SkPaint&); | 94 void applyOpaqueRegionFromLayer(const GraphicsContext*, const SkRect& layerO
paqueRect, const SkPaint&); |
92 void markRectAsOpaque(const SkRect&); | 95 void markRectAsOpaque(const SkRect&); |
93 void markRectAsNonOpaque(const SkRect&); | 96 void markRectAsNonOpaque(const SkRect&); |
94 void markAllAsNonOpaque(); | 97 void markAllAsNonOpaque(); |
95 | 98 |
96 SkRect& currentTrackingOpaqueRect(); | 99 SkRect& currentTrackingOpaqueRect(); |
97 | 100 |
98 SkRect m_opaqueRect; | 101 SkRect m_opaqueRect; |
| 102 bool m_treatOverwriteAsOpaque; |
99 | 103 |
100 Vector<CanvasLayerState, 3> m_canvasLayerStack; | 104 Vector<CanvasLayerState, 3> m_canvasLayerStack; |
101 }; | 105 }; |
102 | 106 |
103 } | 107 } |
104 #endif // OpaqueRegionSkia_h | 108 #endif // OpaqueRegionSkia_h |
OLD | NEW |