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

Side by Side Diff: Source/core/platform/graphics/GraphicsContext3D.h

Issue 93873009: Moved GL enums from GraphicsContext3D to a more generic location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed over to use the standard GL headers and enums. Also fixed some minor style issues. Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef GraphicsContext3D_h 26 #ifndef GraphicsContext3D_h
27 #define GraphicsContext3D_h 27 #define GraphicsContext3D_h
28 28
29 #include "core/platform/graphics/Extensions3D.h" 29 #include "core/platform/graphics/Extensions3D.h"
30 #include "core/platform/graphics/Image.h" 30 #include "core/platform/graphics/Image.h"
31 #include "platform/geometry/IntRect.h" 31 #include "platform/geometry/IntRect.h"
32 #include "platform/graphics/GraphicsTypes3D.h" 32 #include "platform/graphics/GraphicsTypes3D.h"
33 #include "platform/weborigin/KURL.h" 33 #include "platform/weborigin/KURL.h"
34 #include "third_party/khronos/GLES2/gl2.h"
35 #include "third_party/khronos/GLES2/gl2ext.h"
jamesr 2013/12/06 22:41:01 are these used by this header, or just by stuff in
34 #include "third_party/skia/include/core/SkBitmap.h" 36 #include "third_party/skia/include/core/SkBitmap.h"
35 #include "wtf/HashMap.h" 37 #include "wtf/HashMap.h"
36 #include "wtf/HashSet.h" 38 #include "wtf/HashSet.h"
37 #include "wtf/ListHashSet.h" 39 #include "wtf/ListHashSet.h"
38 #include "wtf/Noncopyable.h" 40 #include "wtf/Noncopyable.h"
39 #include "wtf/OwnPtr.h" 41 #include "wtf/OwnPtr.h"
40 #include "wtf/PassOwnPtr.h" 42 #include "wtf/PassOwnPtr.h"
41 #include "wtf/RefCounted.h" 43 #include "wtf/RefCounted.h"
42 #include "wtf/text/WTFString.h" 44 #include "wtf/text/WTFString.h"
43 45
(...skipping 20 matching lines...) Expand all
64 class IntSize; 66 class IntSize;
65 67
66 struct ActiveInfo { 68 struct ActiveInfo {
67 String name; 69 String name;
68 GC3Denum type; 70 GC3Denum type;
69 GC3Dint size; 71 GC3Dint size;
70 }; 72 };
71 73
72 class GraphicsContext3D : public RefCounted<GraphicsContext3D> { 74 class GraphicsContext3D : public RefCounted<GraphicsContext3D> {
73 public: 75 public:
74 enum {
75 DEPTH_BUFFER_BIT = 0x00000100,
76 STENCIL_BUFFER_BIT = 0x00000400,
77 COLOR_BUFFER_BIT = 0x00004000,
78 POINTS = 0x0000,
79 LINES = 0x0001,
80 LINE_LOOP = 0x0002,
81 LINE_STRIP = 0x0003,
82 TRIANGLES = 0x0004,
83 TRIANGLE_STRIP = 0x0005,
84 TRIANGLE_FAN = 0x0006,
85 ZERO = 0,
86 ONE = 1,
87 SRC_COLOR = 0x0300,
88 ONE_MINUS_SRC_COLOR = 0x0301,
89 SRC_ALPHA = 0x0302,
90 ONE_MINUS_SRC_ALPHA = 0x0303,
91 DST_ALPHA = 0x0304,
92 ONE_MINUS_DST_ALPHA = 0x0305,
93 DST_COLOR = 0x0306,
94 ONE_MINUS_DST_COLOR = 0x0307,
95 SRC_ALPHA_SATURATE = 0x0308,
96 FUNC_ADD = 0x8006,
97 BLEND_EQUATION = 0x8009,
98 BLEND_EQUATION_RGB = 0x8009,
99 BLEND_EQUATION_ALPHA = 0x883D,
100 FUNC_SUBTRACT = 0x800A,
101 FUNC_REVERSE_SUBTRACT = 0x800B,
102 BLEND_DST_RGB = 0x80C8,
103 BLEND_SRC_RGB = 0x80C9,
104 BLEND_DST_ALPHA = 0x80CA,
105 BLEND_SRC_ALPHA = 0x80CB,
106 CONSTANT_COLOR = 0x8001,
107 ONE_MINUS_CONSTANT_COLOR = 0x8002,
108 CONSTANT_ALPHA = 0x8003,
109 ONE_MINUS_CONSTANT_ALPHA = 0x8004,
110 BLEND_COLOR = 0x8005,
111 ARRAY_BUFFER = 0x8892,
112 ELEMENT_ARRAY_BUFFER = 0x8893,
113 ARRAY_BUFFER_BINDING = 0x8894,
114 ELEMENT_ARRAY_BUFFER_BINDING = 0x8895,
115 STREAM_DRAW = 0x88E0,
116 STATIC_DRAW = 0x88E4,
117 DYNAMIC_DRAW = 0x88E8,
118 BUFFER_SIZE = 0x8764,
119 BUFFER_USAGE = 0x8765,
120 CURRENT_VERTEX_ATTRIB = 0x8626,
121 FRONT = 0x0404,
122 BACK = 0x0405,
123 FRONT_AND_BACK = 0x0408,
124 TEXTURE_2D = 0x0DE1,
125 CULL_FACE = 0x0B44,
126 BLEND = 0x0BE2,
127 DITHER = 0x0BD0,
128 STENCIL_TEST = 0x0B90,
129 DEPTH_TEST = 0x0B71,
130 SCISSOR_TEST = 0x0C11,
131 POLYGON_OFFSET_FILL = 0x8037,
132 SAMPLE_ALPHA_TO_COVERAGE = 0x809E,
133 SAMPLE_COVERAGE = 0x80A0,
134 NO_ERROR = 0,
135 INVALID_ENUM = 0x0500,
136 INVALID_VALUE = 0x0501,
137 INVALID_OPERATION = 0x0502,
138 OUT_OF_MEMORY = 0x0505,
139 CW = 0x0900,
140 CCW = 0x0901,
141 LINE_WIDTH = 0x0B21,
142 ALIASED_POINT_SIZE_RANGE = 0x846D,
143 ALIASED_LINE_WIDTH_RANGE = 0x846E,
144 CULL_FACE_MODE = 0x0B45,
145 FRONT_FACE = 0x0B46,
146 DEPTH_RANGE = 0x0B70,
147 DEPTH_WRITEMASK = 0x0B72,
148 DEPTH_CLEAR_VALUE = 0x0B73,
149 DEPTH_FUNC = 0x0B74,
150 STENCIL_CLEAR_VALUE = 0x0B91,
151 STENCIL_FUNC = 0x0B92,
152 STENCIL_FAIL = 0x0B94,
153 STENCIL_PASS_DEPTH_FAIL = 0x0B95,
154 STENCIL_PASS_DEPTH_PASS = 0x0B96,
155 STENCIL_REF = 0x0B97,
156 STENCIL_VALUE_MASK = 0x0B93,
157 STENCIL_WRITEMASK = 0x0B98,
158 STENCIL_BACK_FUNC = 0x8800,
159 STENCIL_BACK_FAIL = 0x8801,
160 STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802,
161 STENCIL_BACK_PASS_DEPTH_PASS = 0x8803,
162 STENCIL_BACK_REF = 0x8CA3,
163 STENCIL_BACK_VALUE_MASK = 0x8CA4,
164 STENCIL_BACK_WRITEMASK = 0x8CA5,
165 VIEWPORT = 0x0BA2,
166 SCISSOR_BOX = 0x0C10,
167 COLOR_CLEAR_VALUE = 0x0C22,
168 COLOR_WRITEMASK = 0x0C23,
169 UNPACK_ALIGNMENT = 0x0CF5,
170 PACK_ALIGNMENT = 0x0D05,
171 MAX_TEXTURE_SIZE = 0x0D33,
172 MAX_VIEWPORT_DIMS = 0x0D3A,
173 SUBPIXEL_BITS = 0x0D50,
174 RED_BITS = 0x0D52,
175 GREEN_BITS = 0x0D53,
176 BLUE_BITS = 0x0D54,
177 ALPHA_BITS = 0x0D55,
178 DEPTH_BITS = 0x0D56,
179 STENCIL_BITS = 0x0D57,
180 POLYGON_OFFSET_UNITS = 0x2A00,
181 POLYGON_OFFSET_FACTOR = 0x8038,
182 TEXTURE_BINDING_2D = 0x8069,
183 SAMPLE_BUFFERS = 0x80A8,
184 SAMPLES = 0x80A9,
185 SAMPLE_COVERAGE_VALUE = 0x80AA,
186 SAMPLE_COVERAGE_INVERT = 0x80AB,
187 NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2,
188 COMPRESSED_TEXTURE_FORMATS = 0x86A3,
189 DONT_CARE = 0x1100,
190 FASTEST = 0x1101,
191 NICEST = 0x1102,
192 GENERATE_MIPMAP_HINT = 0x8192,
193 BYTE = 0x1400,
194 UNSIGNED_BYTE = 0x1401,
195 SHORT = 0x1402,
196 UNSIGNED_SHORT = 0x1403,
197 INT = 0x1404,
198 UNSIGNED_INT = 0x1405,
199 FLOAT = 0x1406,
200 HALF_FLOAT_OES = 0x8D61,
201 FIXED = 0x140C,
202 DEPTH_COMPONENT = 0x1902,
203 ALPHA = 0x1906,
204 RGB = 0x1907,
205 RGBA = 0x1908,
206 BGRA = 0x80E1,
207 LUMINANCE = 0x1909,
208 LUMINANCE_ALPHA = 0x190A,
209 UNSIGNED_SHORT_4_4_4_4 = 0x8033,
210 UNSIGNED_SHORT_5_5_5_1 = 0x8034,
211 UNSIGNED_SHORT_5_6_5 = 0x8363,
212 FRAGMENT_SHADER = 0x8B30,
213 VERTEX_SHADER = 0x8B31,
214 MAX_VERTEX_ATTRIBS = 0x8869,
215 MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB,
216 MAX_VARYING_VECTORS = 0x8DFC,
217 MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D,
218 MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C,
219 MAX_TEXTURE_IMAGE_UNITS = 0x8872,
220 MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD,
221 SHADER_TYPE = 0x8B4F,
222 DELETE_STATUS = 0x8B80,
223 LINK_STATUS = 0x8B82,
224 VALIDATE_STATUS = 0x8B83,
225 ATTACHED_SHADERS = 0x8B85,
226 ACTIVE_UNIFORMS = 0x8B86,
227 ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87,
228 ACTIVE_ATTRIBUTES = 0x8B89,
229 ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A,
230 SHADING_LANGUAGE_VERSION = 0x8B8C,
231 CURRENT_PROGRAM = 0x8B8D,
232 NEVER = 0x0200,
233 LESS = 0x0201,
234 EQUAL = 0x0202,
235 LEQUAL = 0x0203,
236 GREATER = 0x0204,
237 NOTEQUAL = 0x0205,
238 GEQUAL = 0x0206,
239 ALWAYS = 0x0207,
240 KEEP = 0x1E00,
241 REPLACE = 0x1E01,
242 INCR = 0x1E02,
243 DECR = 0x1E03,
244 INVERT = 0x150A,
245 INCR_WRAP = 0x8507,
246 DECR_WRAP = 0x8508,
247 VENDOR = 0x1F00,
248 RENDERER = 0x1F01,
249 VERSION = 0x1F02,
250 EXTENSIONS = 0x1F03,
251 NEAREST = 0x2600,
252 LINEAR = 0x2601,
253 NEAREST_MIPMAP_NEAREST = 0x2700,
254 LINEAR_MIPMAP_NEAREST = 0x2701,
255 NEAREST_MIPMAP_LINEAR = 0x2702,
256 LINEAR_MIPMAP_LINEAR = 0x2703,
257 TEXTURE_MAG_FILTER = 0x2800,
258 TEXTURE_MIN_FILTER = 0x2801,
259 TEXTURE_WRAP_S = 0x2802,
260 TEXTURE_WRAP_T = 0x2803,
261 TEXTURE = 0x1702,
262 TEXTURE_CUBE_MAP = 0x8513,
263 TEXTURE_BINDING_CUBE_MAP = 0x8514,
264 TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515,
265 TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516,
266 TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517,
267 TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518,
268 TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519,
269 TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A,
270 MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C,
271 TEXTURE0 = 0x84C0,
272 TEXTURE1 = 0x84C1,
273 TEXTURE2 = 0x84C2,
274 TEXTURE3 = 0x84C3,
275 TEXTURE4 = 0x84C4,
276 TEXTURE5 = 0x84C5,
277 TEXTURE6 = 0x84C6,
278 TEXTURE7 = 0x84C7,
279 TEXTURE8 = 0x84C8,
280 TEXTURE9 = 0x84C9,
281 TEXTURE10 = 0x84CA,
282 TEXTURE11 = 0x84CB,
283 TEXTURE12 = 0x84CC,
284 TEXTURE13 = 0x84CD,
285 TEXTURE14 = 0x84CE,
286 TEXTURE15 = 0x84CF,
287 TEXTURE16 = 0x84D0,
288 TEXTURE17 = 0x84D1,
289 TEXTURE18 = 0x84D2,
290 TEXTURE19 = 0x84D3,
291 TEXTURE20 = 0x84D4,
292 TEXTURE21 = 0x84D5,
293 TEXTURE22 = 0x84D6,
294 TEXTURE23 = 0x84D7,
295 TEXTURE24 = 0x84D8,
296 TEXTURE25 = 0x84D9,
297 TEXTURE26 = 0x84DA,
298 TEXTURE27 = 0x84DB,
299 TEXTURE28 = 0x84DC,
300 TEXTURE29 = 0x84DD,
301 TEXTURE30 = 0x84DE,
302 TEXTURE31 = 0x84DF,
303 ACTIVE_TEXTURE = 0x84E0,
304 REPEAT = 0x2901,
305 CLAMP_TO_EDGE = 0x812F,
306 MIRRORED_REPEAT = 0x8370,
307 FLOAT_VEC2 = 0x8B50,
308 FLOAT_VEC3 = 0x8B51,
309 FLOAT_VEC4 = 0x8B52,
310 INT_VEC2 = 0x8B53,
311 INT_VEC3 = 0x8B54,
312 INT_VEC4 = 0x8B55,
313 BOOL = 0x8B56,
314 BOOL_VEC2 = 0x8B57,
315 BOOL_VEC3 = 0x8B58,
316 BOOL_VEC4 = 0x8B59,
317 FLOAT_MAT2 = 0x8B5A,
318 FLOAT_MAT3 = 0x8B5B,
319 FLOAT_MAT4 = 0x8B5C,
320 SAMPLER_2D = 0x8B5E,
321 SAMPLER_CUBE = 0x8B60,
322 VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622,
323 VERTEX_ATTRIB_ARRAY_SIZE = 0x8623,
324 VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624,
325 VERTEX_ATTRIB_ARRAY_TYPE = 0x8625,
326 VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A,
327 VERTEX_ATTRIB_ARRAY_POINTER = 0x8645,
328 VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F,
329 COMPILE_STATUS = 0x8B81,
330 INFO_LOG_LENGTH = 0x8B84,
331 SHADER_SOURCE_LENGTH = 0x8B88,
332 SHADER_COMPILER = 0x8DFA,
333 SHADER_BINARY_FORMATS = 0x8DF8,
334 NUM_SHADER_BINARY_FORMATS = 0x8DF9,
335 LOW_FLOAT = 0x8DF0,
336 MEDIUM_FLOAT = 0x8DF1,
337 HIGH_FLOAT = 0x8DF2,
338 LOW_INT = 0x8DF3,
339 MEDIUM_INT = 0x8DF4,
340 HIGH_INT = 0x8DF5,
341 FRAMEBUFFER = 0x8D40,
342 RENDERBUFFER = 0x8D41,
343 RGBA4 = 0x8056,
344 RGB5_A1 = 0x8057,
345 RGB565 = 0x8D62,
346 DEPTH_COMPONENT16 = 0x81A5,
347 STENCIL_INDEX = 0x1901,
348 STENCIL_INDEX8 = 0x8D48,
349 DEPTH_STENCIL = 0x84F9,
350 UNSIGNED_INT_24_8 = 0x84FA,
351 DEPTH24_STENCIL8 = 0x88F0,
352 RENDERBUFFER_WIDTH = 0x8D42,
353 RENDERBUFFER_HEIGHT = 0x8D43,
354 RENDERBUFFER_INTERNAL_FORMAT = 0x8D44,
355 RENDERBUFFER_RED_SIZE = 0x8D50,
356 RENDERBUFFER_GREEN_SIZE = 0x8D51,
357 RENDERBUFFER_BLUE_SIZE = 0x8D52,
358 RENDERBUFFER_ALPHA_SIZE = 0x8D53,
359 RENDERBUFFER_DEPTH_SIZE = 0x8D54,
360 RENDERBUFFER_STENCIL_SIZE = 0x8D55,
361 FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0,
362 FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1,
363 FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2,
364 FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3,
365 COLOR_ATTACHMENT0 = 0x8CE0,
366 DEPTH_ATTACHMENT = 0x8D00,
367 STENCIL_ATTACHMENT = 0x8D20,
368 DEPTH_STENCIL_ATTACHMENT = 0x821A,
369 NONE = 0,
370 FRAMEBUFFER_COMPLETE = 0x8CD5,
371 FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6,
372 FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7,
373 FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9,
374 FRAMEBUFFER_UNSUPPORTED = 0x8CDD,
375 FRAMEBUFFER_BINDING = 0x8CA6,
376 RENDERBUFFER_BINDING = 0x8CA7,
377 MAX_RENDERBUFFER_SIZE = 0x84E8,
378 INVALID_FRAMEBUFFER_OPERATION = 0x0506,
379
380 // WebGL-specific enums
381 UNPACK_FLIP_Y_WEBGL = 0x9240,
382 UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
383 CONTEXT_LOST_WEBGL = 0x9242,
384 UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243,
385 BROWSER_DEFAULT_WEBGL = 0x9244
386 };
387
388 // Context creation attributes. 76 // Context creation attributes.
389 struct Attributes { 77 struct Attributes {
390 Attributes() 78 Attributes()
391 : alpha(true) 79 : alpha(true)
392 , depth(true) 80 , depth(true)
393 , stencil(false) 81 , stencil(false)
394 , antialias(true) 82 , antialias(true)
395 , premultipliedAlpha(true) 83 , premultipliedAlpha(true)
396 , preserveDrawingBuffer(false) 84 , preserveDrawingBuffer(false)
397 , noExtensions(false) 85 , noExtensions(false)
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 541
854 GrContext* m_grContext; 542 GrContext* m_grContext;
855 543
856 // Used to flip a bitmap vertically. 544 // Used to flip a bitmap vertically.
857 Vector<uint8_t> m_scanline; 545 Vector<uint8_t> m_scanline;
858 }; 546 };
859 547
860 } // namespace WebCore 548 } // namespace WebCore
861 549
862 #endif // GraphicsContext3D_h 550 #endif // GraphicsContext3D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698