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 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 SkGpuDevice(GrContext*, GrTexture*, unsigned flags = 0); | 75 SkGpuDevice(GrContext*, GrTexture*, unsigned flags = 0); |
76 | 76 |
77 virtual ~SkGpuDevice(); | 77 virtual ~SkGpuDevice(); |
78 | 78 |
79 GrContext* context() const { return fContext; } | 79 GrContext* context() const { return fContext; } |
80 | 80 |
81 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; | 81 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; |
82 | 82 |
83 // overrides from SkBaseDevice | 83 // overrides from SkBaseDevice |
84 virtual int width() const SK_OVERRIDE { | 84 virtual int width() const SK_OVERRIDE { |
85 return NULL == fRenderTarget ? 0 : fRenderTarget->width(); | 85 return NULL == fRenderTarget1 ? 0 : fRenderTarget1->width(); |
86 } | 86 } |
87 virtual int height() const SK_OVERRIDE { | 87 virtual int height() const SK_OVERRIDE { |
88 return NULL == fRenderTarget ? 0 : fRenderTarget->height(); | 88 return NULL == fRenderTarget1 ? 0 : fRenderTarget1->height(); |
89 } | 89 } |
90 virtual bool isOpaque() const SK_OVERRIDE { | 90 virtual bool isOpaque() const SK_OVERRIDE { |
91 return NULL == fRenderTarget ? false | 91 return NULL == fRenderTarget1 ? false |
92 : kRGB_565_GrPixelConfig == fRenderTarget->
config(); | 92 : kRGB_565_GrPixelConfig == fRenderTarget1-
>config(); |
93 } | 93 } |
94 virtual SkBitmap::Config config() const SK_OVERRIDE; | 94 virtual SkBitmap::Config config() const SK_OVERRIDE; |
95 | 95 |
96 virtual void clear(SkColor color) SK_OVERRIDE; | 96 virtual void clear(SkColor color) SK_OVERRIDE; |
97 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 97 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; |
98 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t coun
t, | 98 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t coun
t, |
99 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; | 99 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; |
100 virtual void drawRect(const SkDraw&, const SkRect& r, | 100 virtual void drawRect(const SkDraw&, const SkRect& r, |
101 const SkPaint& paint) SK_OVERRIDE; | 101 const SkPaint& paint) SK_OVERRIDE; |
102 virtual void drawRRect(const SkDraw&, const SkRRect& r, | 102 virtual void drawRRect(const SkDraw&, const SkRRect& r, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 class SkAutoCachedTexture; // used internally | 152 class SkAutoCachedTexture; // used internally |
153 | 153 |
154 | 154 |
155 protected: | 155 protected: |
156 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV
ERRIDE; | 156 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV
ERRIDE; |
157 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; | 157 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; |
158 | 158 |
159 /** PRIVATE / EXPERIMENTAL -- do not call */ | 159 /** PRIVATE / EXPERIMENTAL -- do not call */ |
160 virtual void EXPERIMENTAL_optimize(SkPicture* picture) SK_OVERRIDE; | 160 virtual void EXPERIMENTAL_optimize(SkPicture* picture) SK_OVERRIDE; |
161 /** PRIVATE / EXPERIMENTAL -- do not call */ | 161 /** PRIVATE / EXPERIMENTAL -- do not call */ |
162 virtual bool EXPERIMENTAL_drawPicture(SkPicture* picture) SK_OVERRIDE; | 162 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, SkPicture* picture)
SK_OVERRIDE; |
| 163 /** PRIVATE / EXPERIMENTAL -- do not call */ |
| 164 virtual void EXPERIMENTAL_purge() SK_OVERRIDE; |
163 | 165 |
164 private: | 166 private: |
165 GrContext* fContext; | 167 GrContext* fContext; |
166 | 168 |
167 GrSkDrawProcs* fDrawProcs; | 169 GrSkDrawProcs* fDrawProcs; |
168 | 170 |
169 GrClipData fClipData; | 171 GrClipData fClipData; |
170 | 172 |
171 GrTextContext* fMainTextContext; | 173 GrTextContext* fMainTextContext; |
172 GrTextContext* fFallbackTextContext; | 174 GrTextContext* fFallbackTextContext; |
173 | 175 |
174 // state for our render-target | 176 // state for our render-target |
175 GrRenderTarget* fRenderTarget; | 177 GrRenderTarget* fRenderTarget1; |
176 bool fNeedClear; | 178 bool fNeedClear; |
177 | 179 |
178 // called from rt and tex cons | 180 // called from rt and tex cons |
179 void initFromRenderTarget(GrContext*, GrRenderTarget*, unsigned flags); | 181 void initFromRenderTarget(GrContext*, GrRenderTarget*, unsigned flags); |
180 | 182 |
181 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; | 183 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; |
182 | 184 |
183 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; | 185 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; |
184 | 186 |
185 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t
o override | 187 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t
o override |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 SkCanvas::DrawBitmapRectFlags flags, | 224 SkCanvas::DrawBitmapRectFlags flags, |
223 int tileSize, | 225 int tileSize, |
224 bool bicubic); | 226 bool bicubic); |
225 | 227 |
226 static SkPicture::AccelData::Key ComputeAccelDataKey(); | 228 static SkPicture::AccelData::Key ComputeAccelDataKey(); |
227 | 229 |
228 typedef SkBitmapDevice INHERITED; | 230 typedef SkBitmapDevice INHERITED; |
229 }; | 231 }; |
230 | 232 |
231 #endif | 233 #endif |
OLD | NEW |