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

Unified Diff: Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp

Issue 7125002: Merge 87960 - 2011-06-02 Adrienne Walker <enne@google.com> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp (revision 88206)
+++ Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp (working copy)
@@ -110,13 +110,21 @@
PlatformCanvas::AutoLocker locker(&canvas);
m_hudTexture->bindTexture();
+ bool uploadedViaMap = false;
if (m_useMapSubForUploads) {
Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions());
uint8_t* pixelDest = static_cast<uint8_t*>(extensions->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, hudSize.width(), hudSize.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
- memcpy(pixelDest, locker.pixels(), hudSize.width() * hudSize.height() * 4);
- extensions->unmapTexSubImage2DCHROMIUM(pixelDest);
- } else
+
+ if (pixelDest) {
+ uploadedViaMap = true;
+ memcpy(pixelDest, locker.pixels(), hudSize.width() * hudSize.height() * 4);
+ extensions->unmapTexSubImage2DCHROMIUM(pixelDest);
+ }
+ }
+
+ if (!uploadedViaMap) {
GLC(context, context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, canvas.size().width(), canvas.size().height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, locker.pixels()));
+ }
}
// Draw the HUD onto the default render surface.
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698