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

Unified Diff: Source/platform/graphics/GraphicsContext.cpp

Issue 136583009: Suppress some no-op GraphicsContext calls (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop drawDisplayList() bounds check. Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.cpp
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
index b51203fb649a04edd422aeaa76bd7d161e30f250..0ccd200c59a9ee5f0e77d7b3019760403be62a22 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -465,6 +465,9 @@ bool GraphicsContext::concat(const SkMatrix& matrix)
if (paintingDisabled())
return false;
+ if (matrix.isIdentity())
+ return true;
+
realizeSave(SkCanvas::kMatrix_SaveFlag);
return m_canvas->concat(matrix);
@@ -1587,6 +1590,9 @@ void GraphicsContext::translate(float w, float h)
if (paintingDisabled())
return;
+ if (!w && !h)
+ return;
+
realizeSave(SkCanvas::kMatrix_SaveFlag);
m_canvas->translate(WebCoreFloatToSkScalar(w), WebCoreFloatToSkScalar(h));
@@ -1597,6 +1603,9 @@ void GraphicsContext::scale(const FloatSize& size)
if (paintingDisabled())
return;
+ if (size.width() == 1.0f && size.height() == 1.0f)
+ return;
+
realizeSave(SkCanvas::kMatrix_SaveFlag);
m_canvas->scale(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698