OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 27 matching lines...) Expand all Loading... | |
38 class WebGLSharedObject; | 38 class WebGLSharedObject; |
39 class WebGLRenderingContext; | 39 class WebGLRenderingContext; |
40 | 40 |
41 typedef int ExceptionCode; | 41 typedef int ExceptionCode; |
42 | 42 |
43 class WebGLContextGroup : public RefCounted<WebGLContextGroup> { | 43 class WebGLContextGroup : public RefCounted<WebGLContextGroup> { |
44 public: | 44 public: |
45 static PassRefPtr<WebGLContextGroup> create(); | 45 static PassRefPtr<WebGLContextGroup> create(); |
46 virtual ~WebGLContextGroup(); | 46 virtual ~WebGLContextGroup(); |
47 | 47 |
48 void addContext(WebGLRenderingContext*); | 48 // Adds the context to this group and returns a context index of the context . |
Ken Russell (switch to Gerrit)
2013/06/19 03:51:24
Is the context index used anywhere? It looks like
greggman
2013/06/21 19:54:21
Done.
| |
49 unsigned addContext(WebGLRenderingContext*); | |
49 void removeContext(WebGLRenderingContext*); | 50 void removeContext(WebGLRenderingContext*); |
50 | 51 |
51 void addObject(WebGLSharedObject*); | 52 void addObject(WebGLSharedObject*); |
52 void removeObject(WebGLSharedObject*); | 53 void removeObject(WebGLSharedObject*); |
53 | 54 |
54 GraphicsContext3D* getAGraphicsContext3D(); | 55 GraphicsContext3D* getAGraphicsContext3D(); |
55 | 56 |
56 void loseContextGroup(WebGLRenderingContext::LostContextMode); | 57 void loseContextGroup(WebGLRenderingContext::LostContextMode); |
57 | 58 |
59 // Problem with this is it won't work in workers. You need | |
60 // one object per worker per context group. | |
61 void flushOnContextSwitch(WebGLRenderingContext*); | |
62 | |
63 long generateAcquireRequestId(); | |
64 void cancelAcquireSharedResource(const WebGLRenderingContext*, long); | |
65 | |
58 private: | 66 private: |
59 friend class WebGLObject; | 67 friend class WebGLObject; |
60 | 68 |
61 WebGLContextGroup(); | 69 WebGLContextGroup(); |
62 | 70 |
63 void detachAndRemoveAllObjects(); | 71 void detachAndRemoveAllObjects(); |
64 | 72 |
73 unsigned m_contextCreationCount; | |
74 long m_acquireRequestCount; | |
75 | |
65 HashSet<WebGLRenderingContext*> m_contexts; | 76 HashSet<WebGLRenderingContext*> m_contexts; |
66 HashSet<WebGLSharedObject*> m_groupObjects; | 77 HashSet<WebGLSharedObject*> m_groupObjects; |
67 }; | 78 }; |
68 | 79 |
69 } // namespace WebCore | 80 } // namespace WebCore |
70 | 81 |
71 #endif // WebGLContextGroup_h | 82 #endif // WebGLContextGroup_h |
OLD | NEW |