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

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

Issue 1953623002: Clean up multisampled color mask workaround for DrawingBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp40_drawingbuffer_cleanup
Patch Set: Comments from kbr and fix up a conditional. Created 4 years, 7 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 struct TextureParameters { 236 struct TextureParameters {
237 DISALLOW_NEW(); 237 DISALLOW_NEW();
238 GLenum target = 0; 238 GLenum target = 0;
239 GLenum internalColorFormat = 0; 239 GLenum internalColorFormat = 0;
240 240
241 // The internal color format used when allocating storage for the 241 // The internal color format used when allocating storage for the
242 // texture. This may be different from internalColorFormat if RGB 242 // texture. This may be different from internalColorFormat if RGB
243 // emulation is required. 243 // emulation is required.
244 GLenum creationInternalColorFormat = 0; 244 GLenum creationInternalColorFormat = 0;
245 GLenum colorFormat = 0; 245 GLenum colorFormat = 0;
246 GLenum internalRenderbufferFormat = 0;
247 }; 246 };
248 247
249 // If we used CHROMIUM_image as the backing storage for our buffers, 248 // If we used CHROMIUM_image as the backing storage for our buffers,
250 // we need to know the mapping from texture id to image. 249 // we need to know the mapping from texture id to image.
251 struct TextureInfo { 250 struct TextureInfo {
252 DISALLOW_NEW(); 251 DISALLOW_NEW();
253 GLuint textureId = 0; 252 GLuint textureId = 0;
254 GLuint imageId = 0; 253 GLuint imageId = 0;
255 TextureParameters parameters; 254 TextureParameters parameters;
256 }; 255 };
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 void attachColorBufferToReadFramebuffer(); 340 void attachColorBufferToReadFramebuffer();
342 341
343 // Whether the WebGL client desires an explicit resolve. This is 342 // Whether the WebGL client desires an explicit resolve. This is
344 // implemented by forwarding all draw operations to a multisample 343 // implemented by forwarding all draw operations to a multisample
345 // renderbuffer, which is resolved before any read operations or swaps. 344 // renderbuffer, which is resolved before any read operations or swaps.
346 bool wantExplicitResolve(); 345 bool wantExplicitResolve();
347 346
348 // Whether the WebGL client wants a depth or stencil buffer. 347 // Whether the WebGL client wants a depth or stencil buffer.
349 bool wantDepthOrStencil(); 348 bool wantDepthOrStencil();
350 349
350 // The format to use when creating a multisampled renderbuffer.
351 GLenum getMultisampledRenderbufferFormat();
352
353 // Similar to requiresAlphaChannelToBePreserved(), but always targets the
354 // default framebuffer.
355 bool defaultBufferRequiresAlphaChannelToBePreserved();
356
351 const PreserveDrawingBuffer m_preserveDrawingBuffer; 357 const PreserveDrawingBuffer m_preserveDrawingBuffer;
352 bool m_scissorEnabled = false; 358 bool m_scissorEnabled = false;
353 GLuint m_texture2DBinding = 0; 359 GLuint m_texture2DBinding = 0;
354 GLuint m_drawFramebufferBinding = 0; 360 GLuint m_drawFramebufferBinding = 0;
355 GLuint m_readFramebufferBinding = 0; 361 GLuint m_readFramebufferBinding = 0;
356 GLuint m_renderbufferBinding = 0; 362 GLuint m_renderbufferBinding = 0;
357 GLenum m_activeTextureUnit = GL_TEXTURE0; 363 GLenum m_activeTextureUnit = GL_TEXTURE0;
358 GLfloat m_clearColor[4]; 364 GLfloat m_clearColor[4];
359 GLboolean m_colorMask[4]; 365 GLboolean m_colorMask[4];
360 366
(...skipping 10 matching lines...) Expand all
371 TextureInfo texInfo; 377 TextureInfo texInfo;
372 WebExternalTextureMailbox mailbox; 378 WebExternalTextureMailbox mailbox;
373 }; 379 };
374 FrontBufferInfo m_frontColorBuffer; 380 FrontBufferInfo m_frontColorBuffer;
375 381
376 OwnPtr<SameThreadClosure> m_newMailboxCallback; 382 OwnPtr<SameThreadClosure> m_newMailboxCallback;
377 383
378 // This is used when the user requests either a depth or stencil buffer. 384 // This is used when the user requests either a depth or stencil buffer.
379 GLuint m_depthStencilBuffer = 0; 385 GLuint m_depthStencilBuffer = 0;
380 386
381 // For explicit resolve. 387 // When wantExplicitResolve() returns true, the target of all draw
382 GLuint m_intermediateFBO = 0;
383 GLuint m_intermediateRenderbuffer = 0;
384
385 // When wantsExplicitResolve() returns true, the target of all draw
386 // operations. 388 // operations.
387 GLuint m_multisampleFBO = 0; 389 GLuint m_multisampleFBO = 0;
388 390
389 // The id of the renderbuffer storage for |m_multisampleFBO|. 391 // The id of the renderbuffer storage for |m_multisampleFBO|.
390 GLuint m_multisampleRenderbuffer = 0; 392 GLuint m_multisampleRenderbuffer = 0;
391 393
392 // When wantsExplicitResolve() returns false, the target of all draw and 394 // When wantExplicitResolve() returns false, the target of all draw and
393 // read operations. When wantsExplicitResolve() returns true, the target of 395 // read operations. When wantExplicitResolve() returns true, the target of
394 // all read operations. A swap is performed by exchanging |m_colorBuffer| 396 // all read operations. A swap is performed by exchanging |m_colorBuffer|
395 // with |m_frontColorBuffer|. 397 // with |m_frontColorBuffer|.
396 GLuint m_fbo = 0; 398 GLuint m_fbo = 0;
397 399
398 // All information about the texture storage for |m_fbo|. 400 // All information about the texture storage for |m_fbo|.
399 TextureInfo m_colorBuffer; 401 TextureInfo m_colorBuffer;
400 402
401 // True if our contents have been modified since the last presentation of th is buffer. 403 // True if our contents have been modified since the last presentation of th is buffer.
402 bool m_contentsChanged = true; 404 bool m_contentsChanged = true;
403 405
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 // used to resize the Canvas. 441 // used to resize the Canvas.
440 SkBitmap m_resizingBitmap; 442 SkBitmap m_resizingBitmap;
441 443
442 // Used to flip a bitmap vertically. 444 // Used to flip a bitmap vertically.
443 Vector<uint8_t> m_scanline; 445 Vector<uint8_t> m_scanline;
444 }; 446 };
445 447
446 } // namespace blink 448 } // namespace blink
447 449
448 #endif // DrawingBuffer_h 450 #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