Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: src/gpu/GrRODrawState.h

Issue 502533004: Revert of Make setVertexAttribs in GrDrawState take a stride parameter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrRODrawState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 GrRODrawState_DEFINED 8 #ifndef GrRODrawState_DEFINED
9 #define GrRODrawState_DEFINED 9 #define GrRODrawState_DEFINED
10 10
(...skipping 19 matching lines...) Expand all
30 /// @name Vertex Attributes 30 /// @name Vertex Attributes
31 //// 31 ////
32 32
33 enum { 33 enum {
34 kMaxVertexAttribCnt = kLast_GrVertexAttribBinding + 4, 34 kMaxVertexAttribCnt = kLast_GrVertexAttribBinding + 4,
35 }; 35 };
36 36
37 const GrVertexAttrib* getVertexAttribs() const { return fVAPtr; } 37 const GrVertexAttrib* getVertexAttribs() const { return fVAPtr; }
38 int getVertexAttribCount() const { return fVACount; } 38 int getVertexAttribCount() const { return fVACount; }
39 39
40 size_t getVertexStride() const { return fVAStride; } 40 size_t getVertexSize() const { return fVertexSize; }
41 41
42 /** 42 /**
43 * Getters for index into getVertexAttribs() for particular bindings. -1 is returned if the 43 * Getters for index into getVertexAttribs() for particular bindings. -1 is returned if the
44 * binding does not appear in the current attribs. These bindings should app ear only once in 44 * binding does not appear in the current attribs. These bindings should app ear only once in
45 * the attrib array. 45 * the attrib array.
46 */ 46 */
47 47
48 int positionAttributeIndex() const { 48 int positionAttributeIndex() const {
49 return fFixedFunctionVertexAttribIndices[kPosition_GrVertexAttribBinding ]; 49 return fFixedFunctionVertexAttribIndices[kPosition_GrVertexAttribBinding ];
50 } 50 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 /** The GrDrawStates cannot be combined. */ 333 /** The GrDrawStates cannot be combined. */
334 kIncompatible_CombinedState, 334 kIncompatible_CombinedState,
335 /** Either draw state can be used in place of the other. */ 335 /** Either draw state can be used in place of the other. */
336 kAOrB_CombinedState, 336 kAOrB_CombinedState,
337 /** Use the first draw state. */ 337 /** Use the first draw state. */
338 kA_CombinedState, 338 kA_CombinedState,
339 /** Use the second draw state. */ 339 /** Use the second draw state. */
340 kB_CombinedState, 340 kB_CombinedState,
341 }; 341 };
342 342
343 GrRODrawState& operator= (const GrRODrawState& that);
344
343 protected: 345 protected:
344 bool isEqual(const GrRODrawState& that) const; 346 bool isEqual(const GrRODrawState& that) const;
345 347
346 // These fields are roughly sorted by decreasing likelihood of being differe nt in op== 348 // These fields are roughly sorted by decreasing likelihood of being differe nt in op==
347 SkAutoTUnref<GrRenderTarget> fRenderTarget; 349 SkAutoTUnref<GrRenderTarget> fRenderTarget;
348 GrColor fColor; 350 GrColor fColor;
349 SkMatrix fViewMatrix; 351 SkMatrix fViewMatrix;
350 GrColor fBlendConstant; 352 GrColor fBlendConstant;
351 uint32_t fFlagBits; 353 uint32_t fFlagBits;
352 const GrVertexAttrib* fVAPtr; 354 const GrVertexAttrib* fVAPtr;
353 int fVACount; 355 int fVACount;
354 size_t fVAStride; 356 size_t fVertexSize;
355 GrStencilSettings fStencilSettings; 357 GrStencilSettings fStencilSettings;
356 uint8_t fCoverage; 358 uint8_t fCoverage;
357 DrawFace fDrawFace; 359 DrawFace fDrawFace;
358 GrBlendCoeff fSrcBlend; 360 GrBlendCoeff fSrcBlend;
359 GrBlendCoeff fDstBlend; 361 GrBlendCoeff fDstBlend;
360 362
361 typedef SkSTArray<4, GrEffectStage> EffectStageArray; 363 typedef SkSTArray<4, GrEffectStage> EffectStageArray;
362 EffectStageArray fColorStages; 364 EffectStageArray fColorStages;
363 EffectStageArray fCoverageStages; 365 EffectStageArray fCoverageStages;
364 366
365 mutable GrBlendCoeff fOptSrcBlend; 367 mutable GrBlendCoeff fOptSrcBlend;
366 mutable GrBlendCoeff fOptDstBlend; 368 mutable GrBlendCoeff fOptDstBlend;
367 mutable BlendOptFlags fBlendOptFlags; 369 mutable BlendOptFlags fBlendOptFlags;
368 370
369 // This is simply a different representation of info in fVertexAttribs and t hus does 371 // This is simply a different representation of info in fVertexAttribs and t hus does
370 // not need to be compared in op==. 372 // not need to be compared in op==.
371 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ]; 373 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindingCnt ];
372 374
373 private: 375 private:
374 typedef SkRefCnt INHERITED; 376 typedef SkRefCnt INHERITED;
375 }; 377 };
376 378
377 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags); 379 GR_MAKE_BITFIELD_OPS(GrRODrawState::BlendOptFlags);
378 380
379 #endif 381 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrRODrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698