| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 int imageHeight, | 277 int imageHeight, |
| 278 std::unique_ptr<SkLatticeIter> iter, | 278 std::unique_ptr<SkLatticeIter> iter, |
| 279 const SkRect& dst); | 279 const SkRect& dst); |
| 280 | 280 |
| 281 /** | 281 /** |
| 282 * After this returns any pending surface IO will be issued to the backend 3
D API and | 282 * After this returns any pending surface IO will be issued to the backend 3
D API and |
| 283 * if the surface has MSAA it will be resolved. | 283 * if the surface has MSAA it will be resolved. |
| 284 */ | 284 */ |
| 285 void prepareForExternalIO(); | 285 void prepareForExternalIO(); |
| 286 | 286 |
| 287 /** |
| 288 * Reads a rectangle of pixels from the draw context. |
| 289 * @param dstInfo image info for the destination |
| 290 * @param dstBuffer destination pixels for the read |
| 291 * @param dstRowBytes bytes in a row of 'dstBuffer' |
| 292 * @param x x offset w/in the draw context from which to read |
| 293 * @param y y offset w/in the draw context from which to read |
| 294 * |
| 295 * @return true if the read succeeded, false if not. The read can fail becau
se of an |
| 296 * unsupported pixel config. |
| 297 */ |
| 298 bool readPixels(const SkImageInfo& dstInfo, void* dstBuffer, size_t dstRowBy
tes, int x, int y); |
| 299 |
| 300 /** |
| 301 * Writes a rectangle of pixels [srcInfo, srcBuffer, srcRowbytes] into the |
| 302 * drawContext at the specified position. |
| 303 * @param srcInfo image info for the source pixels |
| 304 * @param srcBuffer source for the write |
| 305 * @param srcRowBytes bytes in a row of 'srcBuffer' |
| 306 * @param x x offset w/in the draw context at which to write |
| 307 * @param y y offset w/in the draw context at which to write |
| 308 * |
| 309 * @return true if the write succeeded, false if not. The write can fail bec
ause of an |
| 310 * unsupported pixel config. |
| 311 */ |
| 312 bool writePixels(const SkImageInfo& srcInfo, const void* srcBuffer, size_t s
rcRowBytes, |
| 313 int x, int y); |
| 314 |
| 287 bool isStencilBufferMultisampled() const { | 315 bool isStencilBufferMultisampled() const { |
| 288 return fRenderTarget->isStencilBufferMultisampled(); | 316 return fRenderTarget->isStencilBufferMultisampled(); |
| 289 } | 317 } |
| 290 bool isUnifiedMultisampled() const { return fRenderTarget->isUnifiedMultisam
pled(); } | 318 bool isUnifiedMultisampled() const { return fRenderTarget->isUnifiedMultisam
pled(); } |
| 291 bool hasMixedSamples() const { return fRenderTarget->isMixedSampled(); } | 319 bool hasMixedSamples() const { return fRenderTarget->isMixedSampled(); } |
| 292 | 320 |
| 293 bool mustUseHWAA(const GrPaint& paint) const { | 321 bool mustUseHWAA(const GrPaint& paint) const { |
| 294 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled(); | 322 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled(); |
| 295 } | 323 } |
| 296 | 324 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 425 |
| 398 sk_sp<SkColorSpace> fColorSpace; | 426 sk_sp<SkColorSpace> fColorSpace; |
| 399 SkSurfaceProps fSurfaceProps; | 427 SkSurfaceProps fSurfaceProps; |
| 400 GrAuditTrail* fAuditTrail; | 428 GrAuditTrail* fAuditTrail; |
| 401 | 429 |
| 402 // In debug builds we guard against improper thread handling | 430 // In debug builds we guard against improper thread handling |
| 403 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 431 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
| 404 }; | 432 }; |
| 405 | 433 |
| 406 #endif | 434 #endif |
| OLD | NEW |