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

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

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

Powered by Google App Engine
This is Rietveld 408576698