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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 1361043003: Revert of Make 2D canvas smarter about chosing whether or not to use GPU acceleration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 80725ec9c8524d81133457d73205e20cc4c4457e..87c61553bbf6441278890508e9e323db66d2a90e 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -1376,8 +1376,7 @@
RefPtr<Image> image;
SourceImageStatus sourceImageStatus = InvalidSourceImageStatus;
if (!imageSource->isVideoElement()) {
- AccelerationHint hint = canvas()->buffer()->isAccelerated() ? PreferAcceleration : PreferNoAcceleration;
- image = imageSource->getSourceImageForCanvas(&sourceImageStatus, hint);
+ image = imageSource->getSourceImageForCanvas(&sourceImageStatus);
if (sourceImageStatus == UndecodableSourceImageStatus)
exceptionState.throwDOMException(InvalidStateError, "The HTMLImageElement provided is in the 'broken' state.");
if (!image || !image->width() || !image->height())
@@ -1485,7 +1484,7 @@
SourceImageStatus status;
CanvasImageSource* imageSourceInternal = toImageSourceInternal(imageSource);
- RefPtr<Image> imageForRendering = imageSourceInternal->getSourceImageForCanvas(&status, PreferNoAcceleration);
+ RefPtr<Image> imageForRendering = imageSourceInternal->getSourceImageForCanvas(&status);
switch (status) {
case NormalSourceImageStatus:
@@ -1775,10 +1774,6 @@
void CanvasRenderingContext2D::didProcessTask()
{
- // The rendering surface needs to be prepared now because it will be too late
- // to create a layer once we are in the paint invalidation phase.
- canvas()->prepareSurfaceForPaintingIfNeeded();
-
pruneLocalFontCache(canvas()->document().canvasFontCache()->maxFonts());
m_pruneLocalFontCacheScheduled = false;
Platform::current()->currentThread()->removeTaskObserver(this);
@@ -2003,9 +1998,9 @@
// The slop built in to this mask rect matches the heuristic used in FontCGWin.cpp for GDI text.
TextRunPaintInfo textRunPaintInfo(textRun);
textRunPaintInfo.bounds = FloatRect(location.x() - fontMetrics.height() / 2,
- location.y() - fontMetrics.ascent() - fontMetrics.lineGap(),
- width + fontMetrics.height(),
- fontMetrics.lineSpacing());
+ location.y() - fontMetrics.ascent() - fontMetrics.lineGap(),
+ width + fontMetrics.height(),
+ fontMetrics.lineSpacing());
if (paintType == CanvasRenderingContext2DState::StrokePaintType)
inflateStrokeRect(textRunPaintInfo.bounds);

Powered by Google App Engine
This is Rietveld 408576698