OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkDevice_DEFINED | 8 #ifndef SkDevice_DEFINED |
9 #define SkDevice_DEFINED | 9 #define SkDevice_DEFINED |
10 | 10 |
11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
13 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
14 #include "SkColor.h" | 14 #include "SkColor.h" |
15 #include "SkImageFilter.h" | 15 #include "SkImageFilter.h" |
16 | 16 |
17 class SkClipStack; | 17 class SkClipStack; |
18 class SkDraw; | 18 class SkDraw; |
| 19 class SkDrawFilter; |
19 struct SkIRect; | 20 struct SkIRect; |
20 class SkMatrix; | 21 class SkMatrix; |
21 class SkMetaData; | 22 class SkMetaData; |
22 class SkRegion; | 23 class SkRegion; |
23 struct SkDeviceProperties; | 24 struct SkDeviceProperties; |
24 class GrRenderTarget; | 25 class GrRenderTarget; |
25 | 26 |
26 class SK_API SkBaseDevice : public SkRefCnt { | 27 class SK_API SkBaseDevice : public SkRefCnt { |
27 public: | 28 public: |
28 SK_DECLARE_INST_COUNT(SkBaseDevice) | 29 SK_DECLARE_INST_COUNT(SkBaseDevice) |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 virtual void drawPosText(const SkDraw&, const void* text, size_t len, | 219 virtual void drawPosText(const SkDraw&, const void* text, size_t len, |
219 const SkScalar pos[], int scalarsPerPos, | 220 const SkScalar pos[], int scalarsPerPos, |
220 const SkPoint& offset, const SkPaint& paint) = 0; | 221 const SkPoint& offset, const SkPaint& paint) = 0; |
221 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | 222 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, |
222 const SkPoint verts[], const SkPoint texs[], | 223 const SkPoint verts[], const SkPoint texs[], |
223 const SkColor colors[], SkXfermode* xmode, | 224 const SkColor colors[], SkXfermode* xmode, |
224 const uint16_t indices[], int indexCount, | 225 const uint16_t indices[], int indexCount, |
225 const SkPaint& paint) = 0; | 226 const SkPaint& paint) = 0; |
226 // default implementation unrolls the blob runs. | 227 // default implementation unrolls the blob runs. |
227 virtual void drawTextBlob(const SkDraw&, const SkTextBlob*, SkScalar x, SkSc
alar y, | 228 virtual void drawTextBlob(const SkDraw&, const SkTextBlob*, SkScalar x, SkSc
alar y, |
228 const SkPaint& paint); | 229 const SkPaint& paint, SkDrawFilter* drawFilter); |
229 // default implementation calls drawVertices | 230 // default implementation calls drawVertices |
230 virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColo
r colors[4], | 231 virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColo
r colors[4], |
231 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 232 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
232 /** The SkDevice passed will be an SkDevice which was returned by a call to | 233 /** The SkDevice passed will be an SkDevice which was returned by a call to |
233 onCreateCompatibleDevice on this device with kSaveLayer_Usage. | 234 onCreateCompatibleDevice on this device with kSaveLayer_Usage. |
234 */ | 235 */ |
235 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 236 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
236 const SkPaint&) = 0; | 237 const SkPaint&) = 0; |
237 | 238 |
238 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, con
st SkPath&, | 239 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, con
st SkPath&, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 SkDeviceProperties* fLeakyProperties; // will always exist. | 390 SkDeviceProperties* fLeakyProperties; // will always exist. |
390 | 391 |
391 #ifdef SK_DEBUG | 392 #ifdef SK_DEBUG |
392 bool fAttachedToCanvas; | 393 bool fAttachedToCanvas; |
393 #endif | 394 #endif |
394 | 395 |
395 typedef SkRefCnt INHERITED; | 396 typedef SkRefCnt INHERITED; |
396 }; | 397 }; |
397 | 398 |
398 #endif | 399 #endif |
OLD | NEW |