epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 8 | #ifndef SkGLDevice_SWLayer_DEFINED |
| 9 | #define SkGLDevice_SWLayer_DEFINED |
| 10 | |
| 11 | #include "SkGLDevice.h" |
| 12 | |
| 13 | class SkGLDevice_SWLayer : public SkGLDevice { |
| 14 | public: |
| 15 | SkGLDevice_SWLayer(const SkBitmap& bitmap); |
| 16 | virtual ~SkGLDevice_SWLayer(); |
| 17 | |
| 18 | // overrides from SkGLDevice |
| 19 | virtual TexOrientation bindDeviceAsTexture(); |
| 20 | |
| 21 | // overrides from SkDevice |
| 22 | virtual void drawPaint(const SkDraw&, const SkPaint& paint); |
| 23 | virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t count, |
| 24 | const SkPoint[], const SkPaint& paint); |
| 25 | virtual void drawRect(const SkDraw&, const SkRect& r, |
| 26 | const SkPaint& paint); |
| 27 | virtual void drawPath(const SkDraw&, const SkPath& path, |
| 28 | const SkPaint& paint); |
| 29 | virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
| 30 | const SkMatrix& matrix, const SkPaint& paint); |
| 31 | virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, |
| 32 | int x, int y, const SkPaint& paint); |
| 33 | virtual void drawText(const SkDraw&, const void* text, size_t len, |
| 34 | SkScalar x, SkScalar y, const SkPaint& paint); |
| 35 | virtual void drawPosText(const SkDraw&, const void* text, size_t len, |
| 36 | const SkScalar pos[], SkScalar constY, |
| 37 | int scalarsPerPos, const SkPaint& paint); |
| 38 | virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
| 39 | const SkPath& path, const SkMatrix* matrix, |
| 40 | const SkPaint& paint); |
| 41 | virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount, |
| 42 | const SkPoint verts[], const SkPoint texs[], |
| 43 | const SkColor colors[], SkXfermode* xmode, |
| 44 | const uint16_t indices[], int indexCount, |
| 45 | const SkPaint& paint); |
| 46 | virtual void drawDevice(const SkDraw&, SkDevice*, int x, int y, |
| 47 | const SkPaint&); |
| 48 | |
| 49 | private: |
| 50 | GLuint fTextureID; |
| 51 | |
| 52 | typedef SkGLDevice INHERITED; |
| 53 | }; |
| 54 | |
| 55 | #endif |
| 56 | |