| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 * @param buffer memory to read pixels from. | 273 * @param buffer memory to read pixels from. |
| 274 * @param rowBytes number of bytes between consecutive rows. Zero | 274 * @param rowBytes number of bytes between consecutive rows. Zero |
| 275 * means rows are tightly packed. | 275 * means rows are tightly packed. |
| 276 */ | 276 */ |
| 277 bool writePixels(GrSurface* surface, | 277 bool writePixels(GrSurface* surface, |
| 278 int left, int top, int width, int height, | 278 int left, int top, int width, int height, |
| 279 GrPixelConfig config, const void* buffer, | 279 GrPixelConfig config, const void* buffer, |
| 280 size_t rowBytes); | 280 size_t rowBytes); |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * Updates the pixels in a rectangle of a texture using a buffer | 283 * Updates the pixels in a rectangle of a surface using a buffer |
| 284 * | 284 * |
| 285 * @param textre The texture to write to. | 285 * @param surface The surface to write to. |
| 286 * @param left left edge of the rectangle to write (inclusive) | 286 * @param left left edge of the rectangle to write (inclusive) |
| 287 * @param top top edge of the rectangle to write (inclusive) | 287 * @param top top edge of the rectangle to write (inclusive) |
| 288 * @param width width of rectangle to write in pixels. | 288 * @param width width of rectangle to write in pixels. |
| 289 * @param height height of rectangle to write in pixels. | 289 * @param height height of rectangle to write in pixels. |
| 290 * @param config the pixel config of the source buffer | 290 * @param config the pixel config of the source buffer |
| 291 * @param transferBuffer GrBuffer to read pixels from (type must be "kCpuT
oGpu") | 291 * @param transferBuffer GrBuffer to read pixels from (type must be "kCpuT
oGpu") |
| 292 * @param offset offset from the start of the buffer | 292 * @param offset offset from the start of the buffer |
| 293 * @param rowBytes number of bytes between consecutive rows. Zero | 293 * @param rowBytes number of bytes between consecutive rows. Zero |
| 294 * means rows are tightly packed. | 294 * means rows are tightly packed. |
| 295 */ | 295 */ |
| 296 bool transferPixels(GrTexture* texture, | 296 bool transferPixels(GrSurface* surface, |
| 297 int left, int top, int width, int height, | 297 int left, int top, int width, int height, |
| 298 GrPixelConfig config, GrBuffer* transferBuffer, | 298 GrPixelConfig config, GrBuffer* transferBuffer, |
| 299 size_t offset, size_t rowBytes); | 299 size_t offset, size_t rowBytes); |
| 300 | 300 |
| 301 /** | 301 /** |
| 302 * Clear the passed in render target. Ignores the draw state and clip. | 302 * Clear the passed in render target. Ignores the draw state and clip. |
| 303 */ | 303 */ |
| 304 void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget)
; | 304 void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget)
; |
| 305 | 305 |
| 306 | 306 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 GrPixelConfig, | 572 GrPixelConfig, |
| 573 void* buffer, | 573 void* buffer, |
| 574 size_t rowBytes) = 0; | 574 size_t rowBytes) = 0; |
| 575 | 575 |
| 576 // overridden by backend-specific derived class to perform the surface write | 576 // overridden by backend-specific derived class to perform the surface write |
| 577 virtual bool onWritePixels(GrSurface*, | 577 virtual bool onWritePixels(GrSurface*, |
| 578 int left, int top, int width, int height, | 578 int left, int top, int width, int height, |
| 579 GrPixelConfig config, | 579 GrPixelConfig config, |
| 580 const SkTArray<GrMipLevel>& texels) = 0; | 580 const SkTArray<GrMipLevel>& texels) = 0; |
| 581 | 581 |
| 582 // overridden by backend-specific derived class to perform the texture trans
fer | 582 // overridden by backend-specific derived class to perform the surface write |
| 583 virtual bool onTransferPixels(GrTexture*, | 583 virtual bool onTransferPixels(GrSurface*, |
| 584 int left, int top, int width, int height, | 584 int left, int top, int width, int height, |
| 585 GrPixelConfig config, GrBuffer* transferBuffer
, | 585 GrPixelConfig config, GrBuffer* transferBuffer
, |
| 586 size_t offset, size_t rowBytes) = 0; | 586 size_t offset, size_t rowBytes) = 0; |
| 587 | 587 |
| 588 // overridden by backend-specific derived class to perform the resolve | 588 // overridden by backend-specific derived class to perform the resolve |
| 589 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 589 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
| 590 | 590 |
| 591 // overridden by backend specific derived class to perform the copy surface | 591 // overridden by backend specific derived class to perform the copy surface |
| 592 virtual bool onCopySurface(GrSurface* dst, | 592 virtual bool onCopySurface(GrSurface* dst, |
| 593 GrSurface* src, | 593 GrSurface* src, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 611 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; | 611 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; |
| 612 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; | 612 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; |
| 613 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 613 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 614 GrContext* fContext
; | 614 GrContext* fContext
; |
| 615 | 615 |
| 616 friend class GrPathRendering; | 616 friend class GrPathRendering; |
| 617 typedef SkRefCnt INHERITED; | 617 typedef SkRefCnt INHERITED; |
| 618 }; | 618 }; |
| 619 | 619 |
| 620 #endif | 620 #endif |
| OLD | NEW |