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

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

Issue 508663002: Create an optimized draw state but not hooked in yet to gpu pipeline (Closed) Base URL: https://skia.googlesource.com/skia.git@drawBase
Patch Set: Remove unused function 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrOptDrawState_DEFINED
9 #define GrOptDrawState_DEFINED
10
11 #include "GrRODrawState.h"
12
13 class GrDrawState;
14
15 /**
16 * Sub class that is derived from GrRODrawState. This class holds an optimized v ersion of a
bsalomon 2014/08/26 18:41:44 Subclass of GrRODrawState that holds an... ?
17 * drawState. Like it's parent it is meant to be an immutable class, and simply adds a few
18 * helpful data members not in the base class.
19 */
20 class GrOptDrawState : public GrRODrawState {
21 public:
22 /**
23 * Constructs and optimized drawState out of a GrRODrawState.
24 */
25 explicit GrOptDrawState(const GrDrawState& drawState);
26
27 bool operator== (const GrOptDrawState& that) const;
28
29 private:
30 /*
31 * Loops through all the color stage effects to check if the stage will igno re color input or
32 * always output a constant color. In the ignore color input case we can ign ore all previous
33 * stages. In the constant color case, we can ignore all previous stages and
34 * the current one and set the state color to the constant color. Once we de termine the so
35 * called first effective stage, we copy all the effective stages into our o ptimized
36 * state.
37 */
38 void copyEffectiveColorStages(const GrDrawState& ds);
39 /*
bsalomon 2014/08/26 18:41:43 \n
40 * Loops through all the coverage stage effects to check if the stage will i gnore color input.
41 * If a coverage stage will ignore input, then we can ignore all coverage st ages before it. We
42 * loop to determine the first effective coverage stage, and then copy all o f our effective
43 * coverage stages into our optimized state.
44 */
45 void copyEffectiveCoverageStages(const GrDrawState& ds);
46
47 /*
48 * This function takes in a flag and removes the corresponding fixed functio n vertex attributes.
49 * The flags must be in the same order as GrVertexAttribBinding array. In ot herwords the lowest
bsalomon 2014/08/26 18:41:43 I think removeVAFlag should be plural since it can
50 * bit is for the position, the 2nd is for the local coord, and so on.
51 */
52 void removeFixedFunctionVertexAttribs(uint8_t removeVAFlag);
53
54 void removeColorVertexAttrib();
55
56 bool fInputColorIsUsed;
bsalomon 2014/08/26 18:41:43 What's the use case for these?
egdaniel 2014/08/26 18:50:52 Ahh comment only made into last cl for these. Basi
57 bool fInputCoverageIsUsed;
58
59 SkAutoSTArray<4, GrVertexAttrib> fOptVA;
60
61 typedef GrRODrawState INHERITED;
62 };
63
64 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698