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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 const SkScalar pos[], SkScalar constY, | 235 const SkScalar pos[], SkScalar constY, |
236 int scalarsPerPos, const SkPaint& paint) = 0; | 236 int scalarsPerPos, const SkPaint& paint) = 0; |
237 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, | 237 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
238 const SkPath& path, const SkMatrix* matrix, | 238 const SkPath& path, const SkMatrix* matrix, |
239 const SkPaint& paint) = 0; | 239 const SkPaint& paint) = 0; |
240 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | 240 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, |
241 const SkPoint verts[], const SkPoint texs[], | 241 const SkPoint verts[], const SkPoint texs[], |
242 const SkColor colors[], SkXfermode* xmode, | 242 const SkColor colors[], SkXfermode* xmode, |
243 const uint16_t indices[], int indexCount, | 243 const uint16_t indices[], int indexCount, |
244 const SkPaint& paint) = 0; | 244 const SkPaint& paint) = 0; |
| 245 |
| 246 // Default impl uses the draw text methods. |
| 247 virtual void drawTextBlob(const SkDraw&, const SkTextBlob* blob, |
| 248 const SkPaint& paint); |
| 249 |
245 // default implementation calls drawVertices | 250 // default implementation calls drawVertices |
246 virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColo
r colors[4], | 251 virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColo
r colors[4], |
247 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); | 252 const SkPoint texCoords[4], SkXfermode* xmode, const
SkPaint& paint); |
248 /** The SkDevice passed will be an SkDevice which was returned by a call to | 253 /** The SkDevice passed will be an SkDevice which was returned by a call to |
249 onCreateDevice on this device with kSaveLayer_Usage. | 254 onCreateDevice on this device with kSaveLayer_Usage. |
250 */ | 255 */ |
251 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 256 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
252 const SkPaint&) = 0; | 257 const SkPaint&) = 0; |
253 | 258 |
254 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y
); | 259 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y
); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 private: | 360 private: |
356 friend class SkCanvas; | 361 friend class SkCanvas; |
357 friend struct DeviceCM; //for setMatrixClip | 362 friend struct DeviceCM; //for setMatrixClip |
358 friend class SkDraw; | 363 friend class SkDraw; |
359 friend class SkDrawIter; | 364 friend class SkDrawIter; |
360 friend class SkDeviceFilteredPaint; | 365 friend class SkDeviceFilteredPaint; |
361 friend class SkDeviceImageFilterProxy; | 366 friend class SkDeviceImageFilterProxy; |
362 friend class SkDeferredDevice; // for newSurface | 367 friend class SkDeferredDevice; // for newSurface |
363 | 368 |
364 friend class SkSurface_Raster; | 369 friend class SkSurface_Raster; |
| 370 friend class SkTextChunk; // FIXME: ewww |
365 | 371 |
366 // used to change the backend's pixels (and possibly config/rowbytes) | 372 // used to change the backend's pixels (and possibly config/rowbytes) |
367 // but cannot change the width/height, so there should be no change to | 373 // but cannot change the width/height, so there should be no change to |
368 // any clip information. | 374 // any clip information. |
369 // TODO: move to SkBitmapDevice | 375 // TODO: move to SkBitmapDevice |
370 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} | 376 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} |
371 | 377 |
372 // just called by SkCanvas when built as a layer | 378 // just called by SkCanvas when built as a layer |
373 void setOrigin(int x, int y) { fOrigin.set(x, y); } | 379 void setOrigin(int x, int y) { fOrigin.set(x, y); } |
374 // just called by SkCanvas for saveLayer | 380 // just called by SkCanvas for saveLayer |
(...skipping 13 matching lines...) Expand all Loading... |
388 SkMetaData* fMetaData; | 394 SkMetaData* fMetaData; |
389 | 395 |
390 #ifdef SK_DEBUG | 396 #ifdef SK_DEBUG |
391 bool fAttachedToCanvas; | 397 bool fAttachedToCanvas; |
392 #endif | 398 #endif |
393 | 399 |
394 typedef SkRefCnt INHERITED; | 400 typedef SkRefCnt INHERITED; |
395 }; | 401 }; |
396 | 402 |
397 #endif | 403 #endif |
OLD | NEW |