| 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
| 9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
| 10 | 10 |
| 11 #include "GrBlend.h" |
| 12 #include "GrProgramResource.h" |
| 11 #include "GrRODrawState.h" | 13 #include "GrRODrawState.h" |
| 12 | |
| 13 #include "GrBlend.h" | |
| 14 #include "effects/GrSimpleTextureEffect.h" | 14 #include "effects/GrSimpleTextureEffect.h" |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Modifiable subclass derived from GrRODrawState. The majority of the data that
represents a draw | 17 * Modifiable subclass derived from GrRODrawState. The majority of the data that
represents a draw |
| 18 * state is stored in the parent class. GrDrawState contains methods for setting
, adding to, etc. | 18 * state is stored in the parent class. GrDrawState contains methods for setting
, adding to, etc. |
| 19 * various data members of the draw state. This class is used to configure the s
tate used when | 19 * various data members of the draw state. This class is used to configure the s
tate used when |
| 20 * issuing draws via GrDrawTarget. | 20 * issuing draws via GrDrawTarget. |
| 21 */ | 21 */ |
| 22 class GrDrawState : public GrRODrawState { | 22 class GrDrawState : public GrRODrawState { |
| 23 public: | 23 public: |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 /////////////////////////////////////////////////////////////////////////// | 372 /////////////////////////////////////////////////////////////////////////// |
| 373 /// @name Render Target | 373 /// @name Render Target |
| 374 //// | 374 //// |
| 375 | 375 |
| 376 /** | 376 /** |
| 377 * Sets the render-target used at the next drawing call | 377 * Sets the render-target used at the next drawing call |
| 378 * | 378 * |
| 379 * @param target The render target to set. | 379 * @param target The render target to set. |
| 380 */ | 380 */ |
| 381 void setRenderTarget(GrRenderTarget* target) { fRenderTarget.reset(SkSafeRef
(target)); } | 381 void setRenderTarget(GrRenderTarget* target) { |
| 382 fRenderTarget.setResource(SkSafeRef(target), GrProgramResource::kWrite_I
OType); |
| 383 } |
| 382 | 384 |
| 383 /// @} | 385 /// @} |
| 384 | 386 |
| 385 /////////////////////////////////////////////////////////////////////////// | 387 /////////////////////////////////////////////////////////////////////////// |
| 386 /// @name Stencil | 388 /// @name Stencil |
| 387 //// | 389 //// |
| 388 | 390 |
| 389 /** | 391 /** |
| 390 * Sets the stencil settings to use for the next draw. | 392 * Sets the stencil settings to use for the next draw. |
| 391 * Changing the clip has the side-effect of possibly zeroing | 393 * Changing the clip has the side-effect of possibly zeroing |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. | 530 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. |
| 529 // This is used to assert that this condition holds. | 531 // This is used to assert that this condition holds. |
| 530 SkDEBUGCODE(int fBlockEffectRemovalCnt;) | 532 SkDEBUGCODE(int fBlockEffectRemovalCnt;) |
| 531 | 533 |
| 532 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz
e_t stride); | 534 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz
e_t stride); |
| 533 | 535 |
| 534 typedef GrRODrawState INHERITED; | 536 typedef GrRODrawState INHERITED; |
| 535 }; | 537 }; |
| 536 | 538 |
| 537 #endif | 539 #endif |
| OLD | NEW |