| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| 11 #ifndef SkGpuDevice_DEFINED | 11 #ifndef SkGpuDevice_DEFINED |
| 12 #define SkGpuDevice_DEFINED | 12 #define SkGpuDevice_DEFINED |
| 13 | 13 |
| 14 #include "SkGr.h" | 14 #include "SkGr.h" |
| 15 #include "SkBitmap.h" | 15 #include "SkBitmap.h" |
| 16 #include "SkDevice.h" | 16 #include "SkDevice.h" |
| 17 #include "SkRegion.h" | 17 #include "SkRegion.h" |
| 18 #include "GrContext.h" | 18 #include "GrContext.h" |
| 19 | 19 |
| 20 struct SkDrawProcs; | 20 struct SkDrawProcs; |
| 21 struct GrSkDrawProcs; | 21 struct GrSkDrawProcs; |
| 22 class GrTextContext; | 22 class GrTextContext; |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * Subclass of SkDevice, which directs all drawing to the GrGpu owned by the | 25 * Subclass of SkDevice, which directs all drawing to the GrGpu owned by the |
| 26 * canvas. | 26 * canvas. |
| 27 */ | 27 */ |
| 28 class SK_API SkGpuDevice : public SkDevice { | 28 class SK_API SkGpuDevice : public SkRasterDevice { |
| 29 public: | 29 public: |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * Creates an SkGpuDevice from a GrSurface. This will fail if the surface is
not a render | 32 * Creates an SkGpuDevice from a GrSurface. This will fail if the surface is
not a render |
| 33 * target. The caller owns a ref on the returned device. | 33 * target. The caller owns a ref on the returned device. |
| 34 */ | 34 */ |
| 35 static SkGpuDevice* Create(GrSurface* surface); | 35 static SkGpuDevice* Create(GrSurface* surface); |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * New device that will create an offscreen renderTarget based on the | 38 * New device that will create an offscreen renderTarget based on the |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 const SkPaint&) SK_OVERRIDE; | 97 const SkPaint&) SK_OVERRIDE; |
| 98 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | 98 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, |
| 99 const SkPoint verts[], const SkPoint texs[], | 99 const SkPoint verts[], const SkPoint texs[], |
| 100 const SkColor colors[], SkXfermode* xmode, | 100 const SkColor colors[], SkXfermode* xmode, |
| 101 const uint16_t indices[], int indexCount, | 101 const uint16_t indices[], int indexCount, |
| 102 const SkPaint&) SK_OVERRIDE; | 102 const SkPaint&) SK_OVERRIDE; |
| 103 virtual void drawDevice(const SkDraw&, SkDevice*, int x, int y, | 103 virtual void drawDevice(const SkDraw&, SkDevice*, int x, int y, |
| 104 const SkPaint&) SK_OVERRIDE; | 104 const SkPaint&) SK_OVERRIDE; |
| 105 virtual bool filterTextFlags(const SkPaint&, TextFlags*) SK_OVERRIDE; | 105 virtual bool filterTextFlags(const SkPaint&, TextFlags*) SK_OVERRIDE; |
| 106 | 106 |
| 107 virtual void flush(); | 107 virtual void flush() SK_OVERRIDE; |
| 108 | 108 |
| 109 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; | 109 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; |
| 110 virtual void onDetachFromCanvas() SK_OVERRIDE; | 110 virtual void onDetachFromCanvas() SK_OVERRIDE; |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * Make's this device's rendertarget current in the underlying 3D API. | 113 * Make's this device's rendertarget current in the underlying 3D API. |
| 114 * Also implicitly flushes. | 114 * Also implicitly flushes. |
| 115 */ | 115 */ |
| 116 virtual void makeRenderTargetCurrent(); | 116 virtual void makeRenderTargetCurrent(); |
| 117 | 117 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 const SkRect& srcRect, | 181 const SkRect& srcRect, |
| 182 const SkMatrix& m, | 182 const SkMatrix& m, |
| 183 const GrTextureParams& params, | 183 const GrTextureParams& params, |
| 184 const SkPaint& paint); | 184 const SkPaint& paint); |
| 185 | 185 |
| 186 /** | 186 /** |
| 187 * Returns non-initialized instance. | 187 * Returns non-initialized instance. |
| 188 */ | 188 */ |
| 189 GrTextContext* getTextContext(); | 189 GrTextContext* getTextContext(); |
| 190 | 190 |
| 191 typedef SkDevice INHERITED; | 191 typedef SkRasterDevice INHERITED; |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 #endif | 194 #endif |
| OLD | NEW |