| 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 "SkPicture.h" | 17 #include "SkPicture.h" |
| 18 #include "SkRegion.h" | 18 #include "SkRegion.h" |
| 19 #include "GrContext.h" | 19 #include "GrContext.h" |
| 20 | 20 |
| 21 struct SkDrawProcs; | 21 struct SkDrawProcs; |
| 22 struct GrSkDrawProcs; | 22 struct GrSkDrawProcs; |
| 23 | 23 |
| 24 class GrAccelData; |
| 25 struct GrCachedLayer; |
| 24 class GrTextContext; | 26 class GrTextContext; |
| 25 | 27 |
| 26 /** | 28 /** |
| 27 * Subclass of SkBaseDevice, which directs all drawing to the GrGpu owned by th
e | 29 * Subclass of SkBaseDevice, which directs all drawing to the GrGpu owned by th
e |
| 28 * canvas. | 30 * canvas. |
| 29 */ | 31 */ |
| 30 class SK_API SkGpuDevice : public SkBaseDevice { | 32 class SK_API SkGpuDevice : public SkBaseDevice { |
| 31 public: | 33 public: |
| 32 enum Flags { | 34 enum Flags { |
| 33 kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear | 35 kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 const SkImageFilter::Context&, | 135 const SkImageFilter::Context&, |
| 134 SkBitmap*, SkIPoint*) SK_OVERRIDE; | 136 SkBitmap*, SkIPoint*) SK_OVERRIDE; |
| 135 | 137 |
| 136 class SkAutoCachedTexture; // used internally | 138 class SkAutoCachedTexture; // used internally |
| 137 | 139 |
| 138 | 140 |
| 139 protected: | 141 protected: |
| 140 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV
ERRIDE; | 142 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV
ERRIDE; |
| 141 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; | 143 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; |
| 142 | 144 |
| 145 static bool FindLayersToHoist(const GrAccelData *gpuData, |
| 146 const SkPicture::OperationList* ops, |
| 147 const SkIRect& query, |
| 148 bool* pullForward); |
| 149 void drawLayers(const SkPicture* picture, |
| 150 const SkTDArray<GrCachedLayer*>& atlased, |
| 151 const SkTDArray<GrCachedLayer*>& nonAtlased); |
| 152 void unlockLayers(const SkPicture* picture); |
| 153 |
| 143 /** PRIVATE / EXPERIMENTAL -- do not call */ | 154 /** PRIVATE / EXPERIMENTAL -- do not call */ |
| 144 virtual void EXPERIMENTAL_optimize(const SkPicture* picture) SK_OVERRIDE; | 155 virtual void EXPERIMENTAL_optimize(const SkPicture* picture) SK_OVERRIDE; |
| 145 /** PRIVATE / EXPERIMENTAL -- do not call */ | 156 /** PRIVATE / EXPERIMENTAL -- do not call */ |
| 146 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, | 157 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, |
| 147 const SkMatrix*, const SkPaint*) SK_OV
ERRIDE; | 158 const SkMatrix*, const SkPaint*) SK_OV
ERRIDE; |
| 148 | 159 |
| 149 private: | 160 private: |
| 150 GrContext* fContext; | 161 GrContext* fContext; |
| 151 | 162 |
| 152 GrSkDrawProcs* fDrawProcs; | 163 GrSkDrawProcs* fDrawProcs; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 bool bicubic); | 226 bool bicubic); |
| 216 | 227 |
| 217 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 228 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
| 218 | 229 |
| 219 static SkPicture::AccelData::Key ComputeAccelDataKey(); | 230 static SkPicture::AccelData::Key ComputeAccelDataKey(); |
| 220 | 231 |
| 221 typedef SkBaseDevice INHERITED; | 232 typedef SkBaseDevice INHERITED; |
| 222 }; | 233 }; |
| 223 | 234 |
| 224 #endif | 235 #endif |
| OLD | NEW |