OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrDrawContext_DEFINED | 8 #ifndef GrDrawContext_DEFINED |
9 #define GrDrawContext_DEFINED | 9 #define GrDrawContext_DEFINED |
10 | 10 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 const SkRect& dst); | 251 const SkRect& dst); |
252 | 252 |
253 /** | 253 /** |
254 * Draws a batch | 254 * Draws a batch |
255 * | 255 * |
256 * @param paint describes how to color pixels. | 256 * @param paint describes how to color pixels. |
257 * @param batch the batch to draw | 257 * @param batch the batch to draw |
258 */ | 258 */ |
259 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); | 259 void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*); |
260 | 260 |
| 261 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); } |
261 int width() const { return fRenderTarget->width(); } | 262 int width() const { return fRenderTarget->width(); } |
262 int height() const { return fRenderTarget->height(); } | 263 int height() const { return fRenderTarget->height(); } |
263 int numColorSamples() const { return fRenderTarget->numColorSamples(); } | 264 int numColorSamples() const { return fRenderTarget->numColorSamples(); } |
264 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); } | 265 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); } |
265 | 266 |
266 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } | 267 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } |
267 | 268 |
268 sk_sp<GrRenderTarget> renderTarget() { return fRenderTarget; } | 269 sk_sp<GrRenderTarget> renderTarget() { return fRenderTarget; } |
269 | 270 |
270 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture());
} | 271 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture());
} |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 GrContext* fContext; | 323 GrContext* fContext; |
323 | 324 |
324 SkSurfaceProps fSurfaceProps; | 325 SkSurfaceProps fSurfaceProps; |
325 GrAuditTrail* fAuditTrail; | 326 GrAuditTrail* fAuditTrail; |
326 | 327 |
327 // In debug builds we guard against improper thread handling | 328 // In debug builds we guard against improper thread handling |
328 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 329 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
329 }; | 330 }; |
330 | 331 |
331 #endif | 332 #endif |
OLD | NEW |