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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 /////////////////////////////////////////////////////////////////////////// | 408 /////////////////////////////////////////////////////////////////////////// |
409 /// @name Render Target | 409 /// @name Render Target |
410 //// | 410 //// |
411 | 411 |
412 /** | 412 /** |
413 * Sets the render-target used at the next drawing call | 413 * Sets the render-target used at the next drawing call |
414 * | 414 * |
415 * @param target The render target to set. | 415 * @param target The render target to set. |
416 */ | 416 */ |
417 void setRenderTarget(GrRenderTarget* target) { fRenderTarget.reset(SkSafeRef
(target)); } | 417 void setRenderTarget(GrRenderTarget* target) { |
| 418 fRenderTarget.setResource(SkSafeRef(target), GrProgramResource::kWrite_I
OType); |
| 419 } |
418 | 420 |
419 /// @} | 421 /// @} |
420 | 422 |
421 /////////////////////////////////////////////////////////////////////////// | 423 /////////////////////////////////////////////////////////////////////////// |
422 /// @name Stencil | 424 /// @name Stencil |
423 //// | 425 //// |
424 | 426 |
425 /** | 427 /** |
426 * Sets the stencil settings to use for the next draw. | 428 * Sets the stencil settings to use for the next draw. |
427 * Changing the clip has the side-effect of possibly zeroing | 429 * Changing the clip has the side-effect of possibly zeroing |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. | 566 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. |
565 // This is used to assert that this condition holds. | 567 // This is used to assert that this condition holds. |
566 SkDEBUGCODE(int fBlockEffectRemovalCnt;) | 568 SkDEBUGCODE(int fBlockEffectRemovalCnt;) |
567 | 569 |
568 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz
e_t stride); | 570 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz
e_t stride); |
569 | 571 |
570 typedef GrRODrawState INHERITED; | 572 typedef GrRODrawState INHERITED; |
571 }; | 573 }; |
572 | 574 |
573 #endif | 575 #endif |
OLD | NEW |