OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * * Redistributions of source code must retain the above copyright | 7 * * 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 * * Redistributions in binary form must reproduce the above | 9 * * Redistributions in binary form must reproduce the above |
10 * copyright notice, this list of conditions and the following disclaimer | 10 * copyright notice, this list of conditions and the following disclaimer |
(...skipping 16 matching lines...) Expand all Loading... |
27 #ifndef WebGLContextAttributes_h | 27 #ifndef WebGLContextAttributes_h |
28 #define WebGLContextAttributes_h | 28 #define WebGLContextAttributes_h |
29 | 29 |
30 #include "bindings/v8/ScriptWrappable.h" | 30 #include "bindings/v8/ScriptWrappable.h" |
31 #include "core/html/canvas/CanvasContextAttributes.h" | 31 #include "core/html/canvas/CanvasContextAttributes.h" |
32 #include "core/platform/graphics/GraphicsContext3D.h" | 32 #include "core/platform/graphics/GraphicsContext3D.h" |
33 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
| 37 class WebGLShareGroup; |
| 38 |
37 class WebGLContextAttributes : public CanvasContextAttributes, public ScriptWrap
pable { | 39 class WebGLContextAttributes : public CanvasContextAttributes, public ScriptWrap
pable { |
38 public: | 40 public: |
39 virtual ~WebGLContextAttributes(); | 41 virtual ~WebGLContextAttributes(); |
40 | 42 |
41 // Create a new attributes object | 43 // Create a new attributes object |
42 static PassRefPtr<WebGLContextAttributes> create(); | 44 static PassRefPtr<WebGLContextAttributes> create(); |
43 | 45 |
44 // Create a new attributes object initialized with preexisting attributes | 46 // Create a new attributes object initialized with preexisting attributes |
45 static PassRefPtr<WebGLContextAttributes> create(GraphicsContext3D::Attribut
es attributes); | 47 static PassRefPtr<WebGLContextAttributes> create(GraphicsContext3D::Attribut
es attributes); |
46 | 48 |
(...skipping 17 matching lines...) Expand all Loading... |
64 // though their alpha channel has already been multiplied into the | 66 // though their alpha channel has already been multiplied into the |
65 // color channels; default=true | 67 // color channels; default=true |
66 bool premultipliedAlpha() const; | 68 bool premultipliedAlpha() const; |
67 void setPremultipliedAlpha(bool premultipliedAlpha); | 69 void setPremultipliedAlpha(bool premultipliedAlpha); |
68 | 70 |
69 // Whether or not to preserve the drawing buffer after presentation to the | 71 // Whether or not to preserve the drawing buffer after presentation to the |
70 // screen; default=false | 72 // screen; default=false |
71 bool preserveDrawingBuffer() const; | 73 bool preserveDrawingBuffer() const; |
72 void setPreserveDrawingBuffer(bool); | 74 void setPreserveDrawingBuffer(bool); |
73 | 75 |
| 76 // Which share group this context uses. |
| 77 PassRefPtr<WebGLShareGroup> group() const; |
| 78 void setGroup(PassRefPtr<WebGLShareGroup>); |
| 79 |
74 // Fetches a copy of the attributes stored in this object in a | 80 // Fetches a copy of the attributes stored in this object in a |
75 // form that can be used to initialize a GraphicsContext3D. | 81 // form that can be used to initialize a GraphicsContext3D. |
76 GraphicsContext3D::Attributes attributes() const; | 82 GraphicsContext3D::Attributes attributes() const; |
77 | 83 |
78 protected: | 84 protected: |
79 WebGLContextAttributes(); | 85 WebGLContextAttributes(); |
80 WebGLContextAttributes(GraphicsContext3D::Attributes attributes); | 86 WebGLContextAttributes(GraphicsContext3D::Attributes attributes); |
81 | 87 |
82 private: | 88 private: |
83 GraphicsContext3D::Attributes m_attrs; | 89 GraphicsContext3D::Attributes m_attrs; |
| 90 RefPtr<WebGLShareGroup> m_shareGroup; |
84 }; | 91 }; |
85 | 92 |
86 } // namespace WebCore | 93 } // namespace WebCore |
87 | 94 |
88 #endif // WebGLContextAttributes_h | 95 #endif // WebGLContextAttributes_h |
OLD | NEW |