| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 // clearRect. NULL rect means clear whole target. If canIgnoreRect is | 425 // clearRect. NULL rect means clear whole target. If canIgnoreRect is |
| 426 // true, it is okay to perform a full clear instead of a partial clear | 426 // true, it is okay to perform a full clear instead of a partial clear |
| 427 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect)
= 0; | 427 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect)
= 0; |
| 428 | 428 |
| 429 // overridden by backend-specific derived class to perform the draw call. | 429 // overridden by backend-specific derived class to perform the draw call. |
| 430 virtual void onGpuDraw(const DrawInfo&) = 0; | 430 virtual void onGpuDraw(const DrawInfo&) = 0; |
| 431 | 431 |
| 432 // overridden by backend-specific derived class to perform the path stencili
ng. | 432 // overridden by backend-specific derived class to perform the path stencili
ng. |
| 433 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0; | 433 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0; |
| 434 virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0; | 434 virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0; |
| 435 virtual void onGpuDrawPaths(size_t, const GrPath**, const SkMatrix*, | 435 virtual void onGpuDrawPaths(int, const GrPath**, const SkMatrix*, |
| 436 SkPath::FillType, SkStrokeRec::Style) = 0; | 436 SkPath::FillType, SkStrokeRec::Style) = 0; |
| 437 | 437 |
| 438 // overridden by backend-specific derived class to perform the read pixels. | 438 // overridden by backend-specific derived class to perform the read pixels. |
| 439 virtual bool onReadPixels(GrRenderTarget* target, | 439 virtual bool onReadPixels(GrRenderTarget* target, |
| 440 int left, int top, int width, int height, | 440 int left, int top, int width, int height, |
| 441 GrPixelConfig, | 441 GrPixelConfig, |
| 442 void* buffer, | 442 void* buffer, |
| 443 size_t rowBytes) = 0; | 443 size_t rowBytes) = 0; |
| 444 | 444 |
| 445 // overridden by backend-specific derived class to perform the texture updat
e | 445 // overridden by backend-specific derived class to perform the texture updat
e |
| (...skipping 23 matching lines...) Expand all Loading... |
| 469 virtual void clearStencil() = 0; | 469 virtual void clearStencil() = 0; |
| 470 | 470 |
| 471 // Given a rt, find or create a stencil buffer and attach it | 471 // Given a rt, find or create a stencil buffer and attach it |
| 472 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); | 472 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); |
| 473 | 473 |
| 474 // GrDrawTarget overrides | 474 // GrDrawTarget overrides |
| 475 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; | 475 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; |
| 476 virtual void onStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE; | 476 virtual void onStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE; |
| 477 virtual void onDrawPath(const GrPath*, SkPath::FillType, | 477 virtual void onDrawPath(const GrPath*, SkPath::FillType, |
| 478 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; | 478 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; |
| 479 virtual void onDrawPaths(size_t, const GrPath**, const SkMatrix*, | 479 virtual void onDrawPaths(int, const GrPath**, const SkMatrix*, |
| 480 SkPath::FillType, SkStrokeRec::Style, | 480 SkPath::FillType, SkStrokeRec::Style, |
| 481 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; | 481 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; |
| 482 | 482 |
| 483 // readies the pools to provide vertex/index data. | 483 // readies the pools to provide vertex/index data. |
| 484 void prepareVertexPool(); | 484 void prepareVertexPool(); |
| 485 void prepareIndexPool(); | 485 void prepareIndexPool(); |
| 486 | 486 |
| 487 void resetContext() { | 487 void resetContext() { |
| 488 // We call this because the client may have messed with the | 488 // We call this because the client may have messed with the |
| 489 // stencil buffer. Perhaps we should detect whether it is a | 489 // stencil buffer. Perhaps we should detect whether it is a |
| (...skipping 25 matching lines...) Expand all Loading... |
| 515 // these are mutable so they can be created on-demand | 515 // these are mutable so they can be created on-demand |
| 516 mutable GrIndexBuffer* fQuadInd
exBuffer; | 516 mutable GrIndexBuffer* fQuadInd
exBuffer; |
| 517 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his | 517 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his |
| 518 // functionality to GrResourceCache. | 518 // functionality to GrResourceCache. |
| 519 ResourceList fResourc
eList; | 519 ResourceList fResourc
eList; |
| 520 | 520 |
| 521 typedef GrDrawTarget INHERITED; | 521 typedef GrDrawTarget INHERITED; |
| 522 }; | 522 }; |
| 523 | 523 |
| 524 #endif | 524 #endif |
| OLD | NEW |