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

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

Issue 1101663007: Make non-AA hairline stroke rects snap to pixels centers so they close. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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/GrPipelineBuilder.cpp ('k') | src/gpu/gl/GrGLProgramDesc.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 GrProgramDesc_DEFINED 8 #ifndef GrProgramDesc_DEFINED
9 #define GrProgramDesc_DEFINED 9 #define GrProgramDesc_DEFINED
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 static bool Less(const GrProgramDesc& a, const GrProgramDesc& b) { 51 static bool Less(const GrProgramDesc& a, const GrProgramDesc& b) {
52 return memcmp(a.asKey(), b.asKey(), a.keyLength() & ~0x3) < 0; 52 return memcmp(a.asKey(), b.asKey(), a.keyLength() & ~0x3) < 0;
53 } 53 }
54 54
55 struct KeyHeader { 55 struct KeyHeader {
56 uint8_t fFragPosKey; // set by GrGLShaderBuilder i f there are 56 uint8_t fFragPosKey; // set by GrGLShaderBuilder i f there are
57 // effects that read the frag ment position. 57 // effects that read the frag ment position.
58 // Otherwise, 0. 58 // Otherwise, 0.
59 59 uint8_t fSnapVerticesToPixelCenters;
60 int8_t fColorEffectCnt; 60 int8_t fColorEffectCnt;
61 int8_t fCoverageEffectCnt; 61 int8_t fCoverageEffectCnt;
62 }; 62 };
63 GR_STATIC_ASSERT(sizeof(KeyHeader) == 4);
63 64
64 int numColorEffects() const { 65 int numColorEffects() const {
65 return this->header().fColorEffectCnt; 66 return this->header().fColorEffectCnt;
66 } 67 }
67 68
68 int numCoverageEffects() const { 69 int numCoverageEffects() const {
69 return this->header().fCoverageEffectCnt; 70 return this->header().fCoverageEffectCnt;
70 } 71 }
71 72
72 int numTotalEffects() const { return this->numColorEffects() + this->numCove rageEffects(); } 73 int numTotalEffects() const { return this->numColorEffects() + this->numCove rageEffects(); }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 }; 117 };
117 118
118 SkSTArray<kPreAllocSize, uint8_t, true>& key() { return fKey; } 119 SkSTArray<kPreAllocSize, uint8_t, true>& key() { return fKey; }
119 const SkSTArray<kPreAllocSize, uint8_t, true>& key() const { return fKey; } 120 const SkSTArray<kPreAllocSize, uint8_t, true>& key() const { return fKey; }
120 121
121 private: 122 private:
122 SkSTArray<kPreAllocSize, uint8_t, true> fKey; 123 SkSTArray<kPreAllocSize, uint8_t, true> fKey;
123 }; 124 };
124 125
125 #endif 126 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPipelineBuilder.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698