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

Side by Side Diff: Source/WebCore/platform/graphics/chromium/ShaderChromium.h

Issue 7590009: Merge 92255 - Source/WebCore: [Chromium] Use edge-distance method for layer anti-aliasing. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 String getShaderString() const; 89 String getShaderString() const;
90 90
91 int matrixLocation() const { return m_matrixLocation; } 91 int matrixLocation() const { return m_matrixLocation; }
92 int texTransformLocation() const { return m_texTransformLocation; } 92 int texTransformLocation() const { return m_texTransformLocation; }
93 93
94 private: 94 private:
95 int m_matrixLocation; 95 int m_matrixLocation;
96 int m_texTransformLocation; 96 int m_texTransformLocation;
97 }; 97 };
98 98
99 class VertexShaderQuad { 99 class VertexShaderTile {
100 public: 100 public:
101 VertexShaderQuad(); 101 VertexShaderTile();
102 102
103 void init(GraphicsContext3D*, unsigned program); 103 void init(GraphicsContext3D*, unsigned program);
104 String getShaderString() const; 104 String getShaderString() const;
105 105
106 int matrixLocation() const { return m_matrixLocation; } 106 int matrixLocation() const { return m_matrixLocation; }
107 int texTransformLocation() const { return m_texTransformLocation; }
108 int pointLocation() const { return m_pointLocation; } 107 int pointLocation() const { return m_pointLocation; }
108 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation ; }
109 109
110 private: 110 private:
111 int m_matrixLocation; 111 int m_matrixLocation;
112 int m_texTransformLocation;
113 int m_pointLocation; 112 int m_pointLocation;
113 int m_vertexTexTransformLocation;
114 }; 114 };
115 115
116 class FragmentTexAlphaBinding { 116 class FragmentTexAlphaBinding {
117 public: 117 public:
118 FragmentTexAlphaBinding(); 118 FragmentTexAlphaBinding();
119 119
120 void init(GraphicsContext3D*, unsigned program); 120 void init(GraphicsContext3D*, unsigned program);
121 int alphaLocation() const { return m_alphaLocation; } 121 int alphaLocation() const { return m_alphaLocation; }
122 int samplerLocation() const { return m_samplerLocation; } 122 int samplerLocation() const { return m_samplerLocation; }
123 123
(...skipping 11 matching lines...) Expand all
135 public: 135 public:
136 String getShaderString() const; 136 String getShaderString() const;
137 }; 137 };
138 138
139 // Swizzles the red and blue component of sampled texel. 139 // Swizzles the red and blue component of sampled texel.
140 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { 140 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding {
141 public: 141 public:
142 String getShaderString() const; 142 String getShaderString() const;
143 }; 143 };
144 144
145 class FragmentTexAlphaAABinding {
146 public:
147 FragmentTexAlphaAABinding();
148
149 void init(GraphicsContext3D*, unsigned program);
150 int alphaLocation() const { return m_alphaLocation; }
151 int samplerLocation() const { return m_samplerLocation; }
152 int fragmentTexTransformLocation() const { return m_fragmentTexTransformLoca tion; }
153 int edgeLocation() const { return m_edgeLocation; }
154
155 private:
156 int m_samplerLocation;
157 int m_alphaLocation;
158 int m_fragmentTexTransformLocation;
159 int m_edgeLocation;
160 };
161
162 class FragmentShaderRGBATexAlphaAA : public FragmentTexAlphaAABinding {
163 public:
164 String getShaderString() const;
165 };
166
167 // Swizzles the red and blue component of sampled texel.
168 class FragmentShaderRGBATexSwizzleAlphaAA : public FragmentTexAlphaAABinding {
169 public:
170 String getShaderString() const;
171 };
172
145 class FragmentShaderRGBATexAlphaMask { 173 class FragmentShaderRGBATexAlphaMask {
146 public: 174 public:
147 FragmentShaderRGBATexAlphaMask(); 175 FragmentShaderRGBATexAlphaMask();
148 String getShaderString() const; 176 String getShaderString() const;
149 177
150 void init(GraphicsContext3D*, unsigned program); 178 void init(GraphicsContext3D*, unsigned program);
151 int alphaLocation() const { return m_alphaLocation; } 179 int alphaLocation() const { return m_alphaLocation; }
152 int samplerLocation() const { return m_samplerLocation; } 180 int samplerLocation() const { return m_samplerLocation; }
153 int maskSamplerLocation() const { return m_maskSamplerLocation; } 181 int maskSamplerLocation() const { return m_maskSamplerLocation; }
154 182
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 219
192 private: 220 private:
193 int m_colorLocation; 221 int m_colorLocation;
194 }; 222 };
195 223
196 } // namespace WebCore 224 } // namespace WebCore
197 225
198 #endif // USE(ACCELERATED_COMPOSITING) 226 #endif // USE(ACCELERATED_COMPOSITING)
199 227
200 #endif 228 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698