| 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 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 bool multisample() const { return m_context && m_context->getContextAttribut
es().antialias && m_multisampleExtensionSupported; } | 84 bool multisample() const { return m_context && m_context->getContextAttribut
es().antialias && m_multisampleExtensionSupported; } |
| 85 | 85 |
| 86 Platform3DObject platformColorBuffer() const; | 86 Platform3DObject platformColorBuffer() const; |
| 87 | 87 |
| 88 #if USE(ACCELERATED_COMPOSITING) | 88 #if USE(ACCELERATED_COMPOSITING) |
| 89 PlatformLayer* platformLayer(); | 89 PlatformLayer* platformLayer(); |
| 90 void publishToPlatformLayer(); | 90 void publishToPlatformLayer(); |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 #if PLATFORM(CHROMIUM) | |
| 94 class WillPublishCallback { | |
| 95 WTF_MAKE_NONCOPYABLE(WillPublishCallback); | |
| 96 public: | |
| 97 WillPublishCallback() { } | |
| 98 virtual ~WillPublishCallback() { } | |
| 99 | |
| 100 virtual void willPublish() = 0; | |
| 101 }; | |
| 102 | |
| 103 void setWillPublishCallback(PassOwnPtr<WillPublishCallback> callback) { m_ca
llback = callback; } | |
| 104 #endif | |
| 105 | |
| 106 #if USE(SKIA) | 93 #if USE(SKIA) |
| 107 void setGrContext(GrContext* ctx); | 94 void setGrContext(GrContext* ctx); |
| 108 void getGrPlatformSurfaceDesc(GrPlatformSurfaceDesc*); | 95 void getGrPlatformSurfaceDesc(GrPlatformSurfaceDesc*); |
| 109 #endif | 96 #endif |
| 110 | 97 |
| 111 PassRefPtr<GraphicsContext3D> graphicsContext3D() const { return m_context;
} | 98 PassRefPtr<GraphicsContext3D> graphicsContext3D() const { return m_context;
} |
| 112 | 99 |
| 113 private: | 100 private: |
| 114 static PassRefPtr<DrawingBuffer> create(GraphicsContext3D*, const IntSize&); | 101 static PassRefPtr<DrawingBuffer> create(GraphicsContext3D*, const IntSize&); |
| 115 | 102 |
| 116 DrawingBuffer(GraphicsContext3D*, const IntSize&, bool multisampleExtensionS
upported, bool packedDepthStencilExtensionSupported); | 103 DrawingBuffer(GraphicsContext3D*, const IntSize&, bool multisampleExtensionS
upported, bool packedDepthStencilExtensionSupported); |
| 117 | 104 |
| 118 // Platform specific function called after reset() so each platform can do e
xtra work if needed | |
| 119 void didReset(); | |
| 120 | |
| 121 RefPtr<GraphicsContext3D> m_context; | 105 RefPtr<GraphicsContext3D> m_context; |
| 122 IntSize m_size; | 106 IntSize m_size; |
| 123 bool m_multisampleExtensionSupported; | 107 bool m_multisampleExtensionSupported; |
| 124 bool m_packedDepthStencilExtensionSupported; | 108 bool m_packedDepthStencilExtensionSupported; |
| 125 Platform3DObject m_fbo; | 109 Platform3DObject m_fbo; |
| 126 Platform3DObject m_colorBuffer; | 110 Platform3DObject m_colorBuffer; |
| 127 | 111 |
| 128 // This is used when we have OES_packed_depth_stencil. | 112 // This is used when we have OES_packed_depth_stencil. |
| 129 Platform3DObject m_depthStencilBuffer; | 113 Platform3DObject m_depthStencilBuffer; |
| 130 | 114 |
| 131 // These are used when we don't. | 115 // These are used when we don't. |
| 132 Platform3DObject m_depthBuffer; | 116 Platform3DObject m_depthBuffer; |
| 133 Platform3DObject m_stencilBuffer; | 117 Platform3DObject m_stencilBuffer; |
| 134 | 118 |
| 135 // For multisampling | 119 // For multisampling |
| 136 Platform3DObject m_multisampleFBO; | 120 Platform3DObject m_multisampleFBO; |
| 137 Platform3DObject m_multisampleColorBuffer; | 121 Platform3DObject m_multisampleColorBuffer; |
| 138 | 122 |
| 139 #if PLATFORM(CHROMIUM) | 123 #if PLATFORM(CHROMIUM) |
| 140 OwnPtr<WillPublishCallback> m_callback; | |
| 141 #if USE(ACCELERATED_COMPOSITING) | 124 #if USE(ACCELERATED_COMPOSITING) |
| 142 RefPtr<Canvas2DLayerChromium> m_platformLayer; | 125 RefPtr<Canvas2DLayerChromium> m_platformLayer; |
| 143 #endif | 126 #endif |
| 144 #endif | 127 #endif |
| 145 | 128 |
| 146 #if PLATFORM(MAC) | 129 #if PLATFORM(MAC) |
| 147 RetainPtr<WebGLLayer> m_platformLayer; | 130 RetainPtr<WebGLLayer> m_platformLayer; |
| 148 #endif | 131 #endif |
| 149 | 132 |
| 150 #if USE(SKIA) | 133 #if USE(SKIA) |
| 151 GrContext* m_grContext; | 134 GrContext* m_grContext; |
| 152 #endif | 135 #endif |
| 153 }; | 136 }; |
| 154 | 137 |
| 155 } // namespace WebCore | 138 } // namespace WebCore |
| 156 | 139 |
| 157 #endif // DrawingBuffer_h | 140 #endif // DrawingBuffer_h |
| OLD | NEW |