| 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 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 /** | 212 /** |
| 213 * Does not handle text decoration. | 213 * Does not handle text decoration. |
| 214 * Decorations (underline and stike-thru) will be handled by SkCanvas. | 214 * Decorations (underline and stike-thru) will be handled by SkCanvas. |
| 215 */ | 215 */ |
| 216 virtual void drawText(const SkDraw&, const void* text, size_t len, | 216 virtual void drawText(const SkDraw&, const void* text, size_t len, |
| 217 SkScalar x, SkScalar y, const SkPaint& paint) = 0; | 217 SkScalar x, SkScalar y, const SkPaint& paint) = 0; |
| 218 virtual void drawPosText(const SkDraw&, const void* text, size_t len, | 218 virtual void drawPosText(const SkDraw&, const void* text, size_t len, |
| 219 const SkScalar pos[], int scalarsPerPos, | 219 const SkScalar pos[], int scalarsPerPos, |
| 220 const SkPoint& offset, const SkPaint& paint) = 0; | 220 const SkPoint& offset, const SkPaint& paint) = 0; |
| 221 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, | |
| 222 const SkPath& path, const SkMatrix* matrix, | |
| 223 const SkPaint& paint) = 0; | |
| 224 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | 221 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, |
| 225 const SkPoint verts[], const SkPoint texs[], | 222 const SkPoint verts[], const SkPoint texs[], |
| 226 const SkColor colors[], SkXfermode* xmode, | 223 const SkColor colors[], SkXfermode* xmode, |
| 227 const uint16_t indices[], int indexCount, | 224 const uint16_t indices[], int indexCount, |
| 228 const SkPaint& paint) = 0; | 225 const SkPaint& paint) = 0; |
| 229 // default implementation unrolls the blob runs. | 226 // default implementation unrolls the blob runs. |
| 230 virtual void drawTextBlob(const SkDraw&, const SkTextBlob*, SkScalar x, SkSc
alar y, | 227 virtual void drawTextBlob(const SkDraw&, const SkTextBlob*, SkScalar x, SkSc
alar y, |
| 231 const SkPaint& paint); | 228 const SkPaint& paint); |
| 232 // default implementation calls drawVertices | 229 // default implementation calls drawVertices |
| 233 virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColo
r colors[4], | 230 virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColo
r colors[4], |
| 234 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 231 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
| 235 /** The SkDevice passed will be an SkDevice which was returned by a call to | 232 /** The SkDevice passed will be an SkDevice which was returned by a call to |
| 236 onCreateCompatibleDevice on this device with kSaveLayer_Usage. | 233 onCreateCompatibleDevice on this device with kSaveLayer_Usage. |
| 237 */ | 234 */ |
| 238 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 235 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
| 239 const SkPaint&) = 0; | 236 const SkPaint&) = 0; |
| 240 | 237 |
| 238 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, con
st SkPath&, |
| 239 const SkMatrix*, const SkPaint&); |
| 241 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y
); | 240 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y
); |
| 242 | 241 |
| 243 /////////////////////////////////////////////////////////////////////////// | 242 /////////////////////////////////////////////////////////////////////////// |
| 244 | 243 |
| 245 /** Update as needed the pixel value in the bitmap, so that the caller can | 244 /** Update as needed the pixel value in the bitmap, so that the caller can |
| 246 access the pixels directly. | 245 access the pixels directly. |
| 247 @return The device contents as a bitmap | 246 @return The device contents as a bitmap |
| 248 */ | 247 */ |
| 249 virtual const SkBitmap& onAccessBitmap() = 0; | 248 virtual const SkBitmap& onAccessBitmap() = 0; |
| 250 | 249 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 SkDeviceProperties* fLeakyProperties; // will always exist. | 389 SkDeviceProperties* fLeakyProperties; // will always exist. |
| 391 | 390 |
| 392 #ifdef SK_DEBUG | 391 #ifdef SK_DEBUG |
| 393 bool fAttachedToCanvas; | 392 bool fAttachedToCanvas; |
| 394 #endif | 393 #endif |
| 395 | 394 |
| 396 typedef SkRefCnt INHERITED; | 395 typedef SkRefCnt INHERITED; |
| 397 }; | 396 }; |
| 398 | 397 |
| 399 #endif | 398 #endif |
| OLD | NEW |