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

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

Issue 1683213002: Clean up drawing buffer code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 { 170 struct PLATFORM_EXPORT SupportedExtensions {
171 SupportedExtensions(); 171 SupportedExtensions();
172 172
173 bool multisample; 173 bool multisample;
174 bool packedDepthStencil;
175 bool depth24; 174 bool depth24;
176 bool discardFramebuffer; 175 bool discardFramebuffer;
177 }; 176 };
178 177
179 DrawingBuffer( 178 DrawingBuffer(
180 PassOwnPtr<WebGraphicsContext3D>, 179 PassOwnPtr<WebGraphicsContext3D>,
181 PassOwnPtr<Extensions3DUtil>, 180 PassOwnPtr<Extensions3DUtil>,
182 const SupportedExtensions&, 181 const SupportedExtensions&,
183 PreserveDrawingBuffer, 182 PreserveDrawingBuffer,
184 WebGraphicsContext3D::Attributes requestedAttributes); 183 WebGraphicsContext3D::Attributes requestedAttributes);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 Platform3DObject m_texture2DBinding; 297 Platform3DObject m_texture2DBinding;
299 Platform3DObject m_drawFramebufferBinding; 298 Platform3DObject m_drawFramebufferBinding;
300 Platform3DObject m_readFramebufferBinding; 299 Platform3DObject m_readFramebufferBinding;
301 GLenum m_activeTextureUnit; 300 GLenum m_activeTextureUnit;
302 301
303 OwnPtr<WebGraphicsContext3D> m_context; 302 OwnPtr<WebGraphicsContext3D> m_context;
304 OwnPtr<Extensions3DUtil> m_extensionsUtil; 303 OwnPtr<Extensions3DUtil> m_extensionsUtil;
305 IntSize m_size; 304 IntSize m_size;
306 WebGraphicsContext3D::Attributes m_requestedAttributes; 305 WebGraphicsContext3D::Attributes m_requestedAttributes;
307 bool m_multisampleExtensionSupported; 306 bool m_multisampleExtensionSupported;
308 bool m_packedDepthStencilExtensionSupported;
309 bool m_depth24ExtensionSupported; 307 bool m_depth24ExtensionSupported;
310 bool m_discardFramebufferSupported; 308 bool m_discardFramebufferSupported;
311 Platform3DObject m_fbo; 309 Platform3DObject m_fbo;
312 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff er. 310 // DrawingBuffer's output is double-buffered. m_colorBuffer is the back buff er.
313 TextureInfo m_colorBuffer; 311 TextureInfo m_colorBuffer;
314 struct FrontBufferInfo { 312 struct FrontBufferInfo {
315 TextureInfo texInfo; 313 TextureInfo texInfo;
316 WebExternalTextureMailbox mailbox; 314 WebExternalTextureMailbox mailbox;
317 }; 315 };
318 FrontBufferInfo m_frontColorBuffer; 316 FrontBufferInfo m_frontColorBuffer;
319 317
320 OwnPtr<Closure> m_newMailboxCallback; 318 OwnPtr<Closure> m_newMailboxCallback;
321 319
322 // This is used when we have OES_packed_depth_stencil.
323 Platform3DObject m_depthStencilBuffer; 320 Platform3DObject m_depthStencilBuffer;
324 321
325 // These are used when we don't. 322 // This is used when we only request depth and Depth24 extension is availabl e.
Ken Russell (switch to Gerrit) 2016/02/10 18:04:31 "Depth24 extension" -> "the OES_depth24 extension"
Zhenyao Mo 2016/02/10 18:21:18 Done.
326 Platform3DObject m_depthBuffer; 323 Platform3DObject m_depthBuffer;
327 Platform3DObject m_stencilBuffer;
328 324
329 // For multisampling. 325 // For multisampling.
330 Platform3DObject m_multisampleFBO; 326 Platform3DObject m_multisampleFBO;
331 Platform3DObject m_multisampleColorBuffer; 327 Platform3DObject m_multisampleColorBuffer;
332 328
333 // True if our contents have been modified since the last presentation of th is buffer. 329 // True if our contents have been modified since the last presentation of th is buffer.
334 bool m_contentsChanged; 330 bool m_contentsChanged;
335 331
336 // True if commit() has been called since the last time markContentsChanged( ) had been called. 332 // True if commit() has been called since the last time markContentsChanged( ) had been called.
337 bool m_contentsChangeCommitted; 333 bool m_contentsChangeCommitted;
(...skipping 30 matching lines...) Expand all
368 // used to resize the Canvas. 364 // used to resize the Canvas.
369 SkBitmap m_resizingBitmap; 365 SkBitmap m_resizingBitmap;
370 366
371 // Used to flip a bitmap vertically. 367 // Used to flip a bitmap vertically.
372 Vector<uint8_t> m_scanline; 368 Vector<uint8_t> m_scanline;
373 }; 369 };
374 370
375 } // namespace blink 371 } // namespace blink
376 372
377 #endif // DrawingBuffer_h 373 #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