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

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

Issue 2328463004: Implement WebGL's commit on the main thread (Closed)
Patch Set: written as a gpu pixel test Created 4 years, 3 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
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 // We reuse the same mailbox name from above since our texture id was consum ed from it. 462 // We reuse the same mailbox name from above since our texture id was consum ed from it.
463 const auto& skImageMailbox = textureMailbox.mailbox(); 463 const auto& skImageMailbox = textureMailbox.mailbox();
464 // Use the sync token generated after producing the mailbox. Waiting for thi s before trying to use 464 // Use the sync token generated after producing the mailbox. Waiting for thi s before trying to use
465 // the mailbox with some other context will ensure it is valid. We wouldn't need to wait for the 465 // the mailbox with some other context will ensure it is valid. We wouldn't need to wait for the
466 // consume done in this function because the texture id it generated would o nly be valid for the 466 // consume done in this function because the texture id it generated would o nly be valid for the
467 // DrawingBuffer's context anyways. 467 // DrawingBuffer's context anyways.
468 const auto& skImageSyncToken = textureMailbox.sync_token(); 468 const auto& skImageSyncToken = textureMailbox.sync_token();
469 469
470 // TODO(xidachen): Create a small pool of recycled textures from ImageBitmap RenderingContext's 470 // TODO(xidachen): Create a small pool of recycled textures from ImageBitmap RenderingContext's
471 // transferFromImageBitmap, and try to use them in DrawingBuffer. 471 // transferFromImageBitmap, and try to use them in DrawingBuffer.
472 return AcceleratedStaticBitmapImage::createFromWebGLContextImage(std::move(s kImage), skImageMailbox, skImageSyncToken); 472 return AcceleratedStaticBitmapImage::createFromWebGLContextImage(std::move(s kImage), skImageMailbox, skImageSyncToken, textureId);
473 } 473 }
474 474
475 DrawingBuffer::TextureParameters DrawingBuffer::chromiumImageTextureParameters() 475 DrawingBuffer::TextureParameters DrawingBuffer::chromiumImageTextureParameters()
476 { 476 {
477 #if OS(MACOSX) 477 #if OS(MACOSX)
478 // A CHROMIUM_image backed texture requires a specialized set of parameters 478 // A CHROMIUM_image backed texture requires a specialized set of parameters
479 // on OSX. 479 // on OSX.
480 TextureParameters parameters; 480 TextureParameters parameters;
481 parameters.target = GC3D_TEXTURE_RECTANGLE_ARB; 481 parameters.target = GC3D_TEXTURE_RECTANGLE_ARB;
482 482
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 1226
1227 void DrawingBuffer::restoreTextureBindings() 1227 void DrawingBuffer::restoreTextureBindings()
1228 { 1228 {
1229 // This class potentially modifies the bindings for GL_TEXTURE_2D and 1229 // This class potentially modifies the bindings for GL_TEXTURE_2D and
1230 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since 1230 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since
1231 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. 1231 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE.
1232 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); 1232 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding);
1233 } 1233 }
1234 1234
1235 } // namespace blink 1235 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698