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

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

Issue 10873098: Merge 125445 - [chromium] Clear HUD canvas contents before drawing into it. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 4 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/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h ('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/CCHeadsUpDisplayLayerImpl.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp (revision 126820)
+++ Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp (working copy)
@@ -72,11 +72,19 @@
if (!m_hudTexture->id() && !m_hudTexture->allocate(CCRenderer::ImplPool, bounds(), GraphicsContext3D::RGBA, CCResourceProvider::TextureUsageAny))
return;
- // Render pixels into the texture.
- OwnPtr<SkCanvas> canvas = adoptPtr(skia::CreateBitmapCanvas(bounds().width(), bounds().height(), false /* opaque */));
- drawHudContents(canvas.get());
+ SkISize canvasSize;
+ if (m_hudCanvas)
+ canvasSize = m_hudCanvas->getDeviceSize();
+ else
+ canvasSize.set(0, 0);
- const SkBitmap* bitmap = &canvas->getDevice()->accessBitmap(false);
+ if (canvasSize.fWidth != bounds().width() || canvasSize.fHeight != bounds().height() || !m_hudCanvas)
+ m_hudCanvas = adoptPtr(skia::CreateBitmapCanvas(bounds().width(), bounds().height(), false /* opaque */));
+
+ m_hudCanvas->clear(SkColorSetARGB(0, 0, 0, 0));
+ drawHudContents(m_hudCanvas.get());
+
+ const SkBitmap* bitmap = &m_hudCanvas->getDevice()->accessBitmap(false);
SkAutoLockPixels locker(*bitmap);
IntRect layerRect(IntPoint(), bounds());
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698