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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h

Issue 1675973002: Prefer to use the OES_depth24 extension for WebGL's depth-only back buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 10 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 int sampleCount() const { return m_sampleCount; } 160 int sampleCount() const { return m_sampleCount; }
161 bool explicitResolveOfMultisampleData() const { return m_antiAliasingMode == MSAAExplicitResolve; } 161 bool explicitResolveOfMultisampleData() const { return m_antiAliasingMode == MSAAExplicitResolve; }
162 162
163 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not 0. 163 // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not 0.
164 // Otherwise, bind to the default FBO. 164 // Otherwise, bind to the default FBO.
165 void restoreFramebufferBindings(); 165 void restoreFramebufferBindings();
166 166
167 void addNewMailboxCallback(PassOwnPtr<Closure> closure) { m_newMailboxCallba ck = std::move(closure); } 167 void addNewMailboxCallback(PassOwnPtr<Closure> closure) { m_newMailboxCallba ck = std::move(closure); }
168 168
169 protected: // For unittests 169 protected: // For unittests
170 struct PLATFORM_EXPORT SupportedExtensions {
171 SupportedExtensions();
172
173 bool multisample;
174 bool packedDepthStencil;
175 bool depth24;
176 bool discardFramebuffer;
177 };
178
170 DrawingBuffer( 179 DrawingBuffer(
171 PassOwnPtr<WebGraphicsContext3D>, 180 PassOwnPtr<WebGraphicsContext3D>,
172 PassOwnPtr<Extensions3DUtil>, 181 PassOwnPtr<Extensions3DUtil>,
173 bool multisampleExtensionSupported, 182 const SupportedExtensions&,
174 bool packedDepthStencilExtensionSupported,
175 bool discardFramebufferSupported,
176 PreserveDrawingBuffer, 183 PreserveDrawingBuffer,
177 WebGraphicsContext3D::Attributes requestedAttributes); 184 WebGraphicsContext3D::Attributes requestedAttributes);
178 185
179 bool initialize(const IntSize&); 186 bool initialize(const IntSize&);
180 187
181 private: 188 private:
182 struct TextureParameters { 189 struct TextureParameters {
183 DISALLOW_NEW(); 190 DISALLOW_NEW();
184 WGC3Denum target; 191 WGC3Denum target;
185 WGC3Denum internalColorFormat; 192 WGC3Denum internalColorFormat;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 Platform3DObject m_drawFramebufferBinding; 299 Platform3DObject m_drawFramebufferBinding;
293 Platform3DObject m_readFramebufferBinding; 300 Platform3DObject m_readFramebufferBinding;
294 GLenum m_activeTextureUnit; 301 GLenum m_activeTextureUnit;
295 302
296 OwnPtr<WebGraphicsContext3D> m_context; 303 OwnPtr<WebGraphicsContext3D> m_context;
297 OwnPtr<Extensions3DUtil> m_extensionsUtil; 304 OwnPtr<Extensions3DUtil> m_extensionsUtil;
298 IntSize m_size; 305 IntSize m_size;
299 WebGraphicsContext3D::Attributes m_requestedAttributes; 306 WebGraphicsContext3D::Attributes m_requestedAttributes;
300 bool m_multisampleExtensionSupported; 307 bool m_multisampleExtensionSupported;
301 bool m_packedDepthStencilExtensionSupported; 308 bool m_packedDepthStencilExtensionSupported;
309 bool m_depth24ExtensionSupported;
302 bool m_discardFramebufferSupported; 310 bool m_discardFramebufferSupported;
303 Platform3DObject m_fbo; 311 Platform3DObject m_fbo;
304 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff er. 312 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff er.
305 TextureInfo m_colorBuffer; 313 TextureInfo m_colorBuffer;
306 struct FrontBufferInfo { 314 struct FrontBufferInfo {
307 TextureInfo texInfo; 315 TextureInfo texInfo;
308 WebExternalTextureMailbox mailbox; 316 WebExternalTextureMailbox mailbox;
309 }; 317 };
310 FrontBufferInfo m_frontColorBuffer; 318 FrontBufferInfo m_frontColorBuffer;
311 319
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 // used to resize the Canvas. 368 // used to resize the Canvas.
361 SkBitmap m_resizingBitmap; 369 SkBitmap m_resizingBitmap;
362 370
363 // Used to flip a bitmap vertically. 371 // Used to flip a bitmap vertically.
364 Vector<uint8_t> m_scanline; 372 Vector<uint8_t> m_scanline;
365 }; 373 };
366 374
367 } // namespace blink 375 } // namespace blink
368 376
369 #endif // DrawingBuffer_h 377 #endif // DrawingBuffer_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698