OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
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 SkGpuDevice_DEFINED | 8 #ifndef SkGpuDevice_DEFINED |
9 #define SkGpuDevice_DEFINED | 9 #define SkGpuDevice_DEFINED |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 const SkRect& dst, const SkPaint& paint) override; | 139 const SkRect& dst, const SkPaint& paint) override; |
140 | 140 |
141 void drawSpecial(const SkDraw&, SkSpecialImage*, | 141 void drawSpecial(const SkDraw&, SkSpecialImage*, |
142 int left, int top, const SkPaint& paint) override; | 142 int left, int top, const SkPaint& paint) override; |
143 sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override; | 143 sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override; |
144 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; | 144 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; |
145 sk_sp<SkSpecialImage> snapSpecial() override; | 145 sk_sp<SkSpecialImage> snapSpecial() override; |
146 | 146 |
147 void flush() override; | 147 void flush() override; |
148 | 148 |
149 void onAttachToCanvas(SkCanvas* canvas) override; | |
150 void onDetachFromCanvas() override; | |
151 | |
152 bool onAccessPixels(SkPixmap*) override; | 149 bool onAccessPixels(SkPixmap*) override; |
153 | 150 |
154 // for debugging purposes only | 151 // for debugging purposes only |
155 void drawTexture(GrTexture*, const SkRect& dst, const SkPaint&); | 152 void drawTexture(GrTexture*, const SkRect& dst, const SkPaint&); |
156 | 153 |
157 protected: | 154 protected: |
158 bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) override; | 155 bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) override; |
159 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) overri
de; | 156 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) overri
de; |
160 bool onShouldDisableLCD(const SkPaint&) const final; | 157 bool onShouldDisableLCD(const SkPaint&) const final; |
161 | 158 |
162 private: | 159 private: |
163 // We want these unreffed in DrawContext, RenderTarget, GrContext order. | 160 // We want these unreffed in DrawContext, RenderTarget, GrContext order. |
164 SkAutoTUnref<GrContext> fContext; | 161 SkAutoTUnref<GrContext> fContext; |
165 sk_sp<GrRenderTarget> fRenderTarget; | 162 sk_sp<GrRenderTarget> fRenderTarget; |
166 sk_sp<GrDrawContext> fDrawContext; | 163 sk_sp<GrDrawContext> fDrawContext; |
167 | 164 |
168 SkAutoTUnref<const SkClipStack> fClipStack; | |
169 SkIPoint fClipOrigin; | 165 SkIPoint fClipOrigin; |
170 GrClipStackClip fClip; | 166 GrClipStackClip fClip; |
171 SkISize fSize; | 167 SkISize fSize; |
172 bool fOpaque; | 168 bool fOpaque; |
173 | 169 |
174 enum Flags { | 170 enum Flags { |
175 kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear | 171 kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear |
176 kIsOpaque_Flag = 1 << 1, //!< Hint from client that rendering to this
device will be | 172 kIsOpaque_Flag = 1 << 1, //!< Hint from client that rendering to this
device will be |
177 // opaque even if the config supports alpha
. | 173 // opaque even if the config supports alpha
. |
178 }; | 174 }; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 const SkImageInfo&, | 270 const SkImageInfo&, |
275 int sampleCount, | 271 int sampleCount, |
276 const SkSurfaceProps*); | 272 const SkSurfaceProps*); |
277 | 273 |
278 friend class GrAtlasTextContext; | 274 friend class GrAtlasTextContext; |
279 friend class SkSurface_Gpu; // for access to surfaceProps | 275 friend class SkSurface_Gpu; // for access to surfaceProps |
280 typedef SkBaseDevice INHERITED; | 276 typedef SkBaseDevice INHERITED; |
281 }; | 277 }; |
282 | 278 |
283 #endif | 279 #endif |
OLD | NEW |