OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrGpu_DEFINED | 8 #ifndef GrGpu_DEFINED |
9 #define GrGpu_DEFINED | 9 #define GrGpu_DEFINED |
10 | 10 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 * @param buffer memory to read pixels from | 259 * @param buffer memory to read pixels from |
260 * @param rowBytes number of bytes between consecutive rows. Zero | 260 * @param rowBytes number of bytes between consecutive rows. Zero |
261 * means rows are tightly packed. | 261 * means rows are tightly packed. |
262 */ | 262 */ |
263 bool writePixels(GrSurface* surface, | 263 bool writePixels(GrSurface* surface, |
264 int left, int top, int width, int height, | 264 int left, int top, int width, int height, |
265 GrPixelConfig config, const void* buffer, | 265 GrPixelConfig config, const void* buffer, |
266 size_t rowBytes); | 266 size_t rowBytes); |
267 | 267 |
268 /** | 268 /** |
| 269 * Updates the pixels in a rectangle of a surface using a GrTransferBuffer |
| 270 * |
| 271 * @param surface The surface to write to. |
| 272 * @param left left edge of the rectangle to write (inclusive) |
| 273 * @param top top edge of the rectangle to write (inclusive) |
| 274 * @param width width of rectangle to write in pixels. |
| 275 * @param height height of rectangle to write in pixels. |
| 276 * @param config the pixel config of the source buffer |
| 277 * @param buffer GrTransferBuffer to read pixels from |
| 278 * @param offset offset from the start of the buffer |
| 279 * @param rowBytes number of bytes between consecutive rows. Zero |
| 280 * means rows are tightly packed. |
| 281 */ |
| 282 bool transferPixels(GrSurface* surface, |
| 283 int left, int top, int width, int height, |
| 284 GrPixelConfig config, GrTransferBuffer* buffer, |
| 285 size_t offset, size_t rowBytes); |
| 286 |
| 287 /** |
269 * Clear the passed in render target. Ignores the draw state and clip. | 288 * Clear the passed in render target. Ignores the draw state and clip. |
270 */ | 289 */ |
271 void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget)
; | 290 void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget)
; |
272 | 291 |
273 | 292 |
274 void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget*
renderTarget); | 293 void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget*
renderTarget); |
275 | 294 |
276 /** | 295 /** |
277 * Discards the contents render target. nullptr indicates that the current r
ender target should | 296 * Discards the contents render target. nullptr indicates that the current r
ender target should |
278 * be discarded. | 297 * be discarded. |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 GrPixelConfig, | 520 GrPixelConfig, |
502 void* buffer, | 521 void* buffer, |
503 size_t rowBytes) = 0; | 522 size_t rowBytes) = 0; |
504 | 523 |
505 // overridden by backend-specific derived class to perform the surface write | 524 // overridden by backend-specific derived class to perform the surface write |
506 virtual bool onWritePixels(GrSurface*, | 525 virtual bool onWritePixels(GrSurface*, |
507 int left, int top, int width, int height, | 526 int left, int top, int width, int height, |
508 GrPixelConfig config, const void* buffer, | 527 GrPixelConfig config, const void* buffer, |
509 size_t rowBytes) = 0; | 528 size_t rowBytes) = 0; |
510 | 529 |
| 530 // overridden by backend-specific derived class to perform the surface write |
| 531 virtual bool onTransferPixels(GrSurface*, |
| 532 int left, int top, int width, int height, |
| 533 GrPixelConfig config, GrTransferBuffer* buffer
, |
| 534 size_t offset, size_t rowBytes) = 0; |
| 535 |
511 // overridden by backend-specific derived class to perform the resolve | 536 // overridden by backend-specific derived class to perform the resolve |
512 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 537 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
513 | 538 |
514 // overridden by backend specific derived class to perform the copy surface | 539 // overridden by backend specific derived class to perform the copy surface |
515 virtual bool onCopySurface(GrSurface* dst, | 540 virtual bool onCopySurface(GrSurface* dst, |
516 GrSurface* src, | 541 GrSurface* src, |
517 const SkIRect& srcRect, | 542 const SkIRect& srcRect, |
518 const SkIPoint& dstPoint) = 0; | 543 const SkIPoint& dstPoint) = 0; |
519 | 544 |
520 void resetContext() { | 545 void resetContext() { |
521 this->onResetContext(fResetBits); | 546 this->onResetContext(fResetBits); |
522 fResetBits = 0; | 547 fResetBits = 0; |
523 ++fResetTimestamp; | 548 ++fResetTimestamp; |
524 } | 549 } |
525 | 550 |
526 ResetTimestamp fResetTi
mestamp; | 551 ResetTimestamp fResetTi
mestamp; |
527 uint32_t fResetBi
ts; | 552 uint32_t fResetBi
ts; |
528 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 553 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
529 GrContext* fContext
; | 554 GrContext* fContext
; |
530 | 555 |
531 friend class GrPathRendering; | 556 friend class GrPathRendering; |
532 typedef SkRefCnt INHERITED; | 557 typedef SkRefCnt INHERITED; |
533 }; | 558 }; |
534 | 559 |
535 #endif | 560 #endif |
OLD | NEW |