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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 enum PrivateDrawStateStateBits { | 323 enum PrivateDrawStateStateBits { |
324 kFirstBit = (GrDrawState::kLastPublicStateBit << 1), | 324 kFirstBit = (GrDrawState::kLastPublicStateBit << 1), |
325 | 325 |
326 kModifyStencilClip_StateBit = kFirstBit, // allows draws to modify | 326 kModifyStencilClip_StateBit = kFirstBit, // allows draws to modify |
327 // stencil bits used for | 327 // stencil bits used for |
328 // clipping. | 328 // clipping. |
329 }; | 329 }; |
330 | 330 |
331 void getPathStencilSettingsForFillType(SkPath::FillType fill, GrStencilSetti ngs* outStencilSettings); | 331 void getPathStencilSettingsForFillType(SkPath::FillType fill, GrStencilSetti ngs* outStencilSettings); |
332 | 332 |
333 // GrDrawTarget Overrides | |
334 virtual void insertEventMarker(const char* marker) SK_OVERRIDE; | |
335 virtual void pushGroupMarker(const char* marker) SK_OVERRIDE; | |
336 virtual void popGroupMarker() SK_OVERRIDE; | |
337 | |
333 protected: | 338 protected: |
334 enum DrawType { | 339 enum DrawType { |
335 kDrawPoints_DrawType, | 340 kDrawPoints_DrawType, |
336 kDrawLines_DrawType, | 341 kDrawLines_DrawType, |
337 kDrawTriangles_DrawType, | 342 kDrawTriangles_DrawType, |
338 kStencilPath_DrawType, | 343 kStencilPath_DrawType, |
339 kDrawPath_DrawType, | 344 kDrawPath_DrawType, |
340 }; | 345 }; |
341 | 346 |
342 DrawType PrimTypeToDrawType(GrPrimitiveType type) { | 347 DrawType PrimTypeToDrawType(GrPrimitiveType type) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
451 | 456 |
452 // overridden by backend-specific derived class to perform the texture updat e | 457 // overridden by backend-specific derived class to perform the texture updat e |
453 virtual bool onWriteTexturePixels(GrTexture* texture, | 458 virtual bool onWriteTexturePixels(GrTexture* texture, |
454 int left, int top, int width, int height, | 459 int left, int top, int width, int height, |
455 GrPixelConfig config, const void* buffer, | 460 GrPixelConfig config, const void* buffer, |
456 size_t rowBytes) = 0; | 461 size_t rowBytes) = 0; |
457 | 462 |
458 // overridden by backend-specific derived class to perform the resolve | 463 // overridden by backend-specific derived class to perform the resolve |
459 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 464 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
460 | 465 |
466 // overridden by backend-specific derived class to perform debug markers | |
bsalomon
2014/02/20 22:14:13
I'd bubble the foo/onFoo split up to GrDT. We can
| |
467 virtual void onInsertEventMarker(const char* marker) = 0; | |
468 virtual void onPushGroupMarker(const char* marker) = 0; | |
469 virtual void onPopGroupMarker() = 0; | |
470 | |
461 // width and height may be larger than rt (if underlying API allows it). | 471 // width and height may be larger than rt (if underlying API allows it). |
462 // Should attach the SB to the RT. Returns false if compatible sb could | 472 // Should attach the SB to the RT. Returns false if compatible sb could |
463 // not be created. | 473 // not be created. |
464 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, int width, int height) = 0; | 474 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, int width, int height) = 0; |
465 | 475 |
466 // attaches an existing SB to an existing RT. | 476 // attaches an existing SB to an existing RT. |
467 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar get*) = 0; | 477 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar get*) = 0; |
468 | 478 |
469 // The GrGpu typically records the clients requested state and then flushes | 479 // The GrGpu typically records the clients requested state and then flushes |
470 // deltas from previous state at draw time. This function does the | 480 // deltas from previous state at draw time. This function does the |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
519 // these are mutable so they can be created on-demand | 529 // these are mutable so they can be created on-demand |
520 mutable GrIndexBuffer* fQuadInd exBuffer; | 530 mutable GrIndexBuffer* fQuadInd exBuffer; |
521 // Used to abandon/release all resources created by this GrGpu. TODO: Move t his | 531 // Used to abandon/release all resources created by this GrGpu. TODO: Move t his |
522 // functionality to GrResourceCache. | 532 // functionality to GrResourceCache. |
523 ResourceList fResourc eList; | 533 ResourceList fResourc eList; |
524 | 534 |
525 typedef GrDrawTarget INHERITED; | 535 typedef GrDrawTarget INHERITED; |
526 }; | 536 }; |
527 | 537 |
528 #endif | 538 #endif |
OLD | NEW |