Title: [120640] trunk/Source/WebCore
- Revision
- 120640
- Author
- [email protected]
- Date
- 2012-06-18 16:16:08 -0700 (Mon, 18 Jun 2012)
Log Message
[chromium] REGRESSION(r120346) ContentLayerPainter should clear rect to be painted
https://bugs.webkit.org/show_bug.cgi?id=89376
Reviewed by Adrienne Walker.
In r120346, a refactor moved a clearRect()/clip() call from ContentLayerPainter - which all
ContentLayerChromiums use - out to OpaqueRectTrackingContentLayerDelegate - which all GraphicsLayerChromium
backed layers use, but which callers using WebContentLayer directly do not use. This meant that the canvas
wasn't cleared/clipped as WebContentLayerClient.h claimed it would be. This moves the clear and the clip
into CanvasLayerTextureUpdater which all paths use, including layers that don't use the ContentLayerPainter.
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerPainter::paint):
* platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
(WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (120639 => 120640)
--- trunk/Source/WebCore/ChangeLog 2012-06-18 23:14:33 UTC (rev 120639)
+++ trunk/Source/WebCore/ChangeLog 2012-06-18 23:16:08 UTC (rev 120640)
@@ -1,3 +1,21 @@
+2012-06-18 James Robinson <[email protected]>
+
+ [chromium] REGRESSION(r120346) ContentLayerPainter should clear rect to be painted
+ https://bugs.webkit.org/show_bug.cgi?id=89376
+
+ Reviewed by Adrienne Walker.
+
+ In r120346, a refactor moved a clearRect()/clip() call from ContentLayerPainter - which all
+ ContentLayerChromiums use - out to OpaqueRectTrackingContentLayerDelegate - which all GraphicsLayerChromium
+ backed layers use, but which callers using WebContentLayer directly do not use. This meant that the canvas
+ wasn't cleared/clipped as WebContentLayerClient.h claimed it would be. This moves the clear and the clip
+ into CanvasLayerTextureUpdater which all paths use, including layers that don't use the ContentLayerPainter.
+
+ * platform/graphics/chromium/ContentLayerChromium.cpp:
+ (WebCore::ContentLayerPainter::paint):
+ * platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
+ (WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
+
2012-06-18 Igor Oliveira <[email protected]>
Unreviewed, rolling out r120119.
Modified: trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp (120639 => 120640)
--- trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp 2012-06-18 23:14:33 UTC (rev 120639)
+++ trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp 2012-06-18 23:16:08 UTC (rev 120640)
@@ -33,6 +33,9 @@
#include "GraphicsContext.h"
#include "LayerPainterChromium.h"
#include "PlatformContextSkia.h"
+#include "SkCanvas.h"
+#include "SkPaint.h"
+#include "SkRect.h"
#include "SkiaUtils.h"
#include "TraceEvent.h"
@@ -63,6 +66,12 @@
scaledContentRect = enclosingIntRect(rect);
}
+ SkPaint paint;
+ paint.setAntiAlias(false);
+ paint.setXfermodeMode(SkXfermode::kClear_Mode);
+ canvas->drawRect(scaledContentRect, paint);
+ canvas->clipRect(scaledContentRect);
+
m_painter->paint(canvas, scaledContentRect, resultingOpaqueRect);
canvas->restore();
Modified: trunk/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp (120639 => 120640)
--- trunk/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp 2012-06-18 23:14:33 UTC (rev 120639)
+++ trunk/Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp 2012-06-18 23:16:08 UTC (rev 120640)
@@ -50,9 +50,6 @@
platformContext.setTrackOpaqueRegion(!m_opaque);
GraphicsContext context(&platformContext);
- context.clearRect(clip);
- context.clip(clip);
-
// Record transform prior to painting, as all opaque tracking will be
// relative to this current value.
AffineTransform canvasToContentTransform = context.getCTM().inverse();
Modified: trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp (120639 => 120640)
--- trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp 2012-06-18 23:14:33 UTC (rev 120639)
+++ trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp 2012-06-18 23:16:08 UTC (rev 120640)
@@ -116,8 +116,6 @@
PlatformContextSkia platformContext(canvas);
platformContext.setDrawingToImageBuffer(true);
GraphicsContext context(&platformContext);
- context.clearRect(contentRect);
- context.clip(contentRect);
// The following is a simplification of ScrollbarThemeComposite::paint.
m_theme->paintScrollbarBackground(&context, m_scrollbar);
@@ -176,8 +174,6 @@
platformContext.setDrawingToImageBuffer(true);
GraphicsContext context(&platformContext);
- context.clearRect(contentRect);
-
// Consider the thumb to be at the origin when painting.
IntRect thumbRect = IntRect(IntPoint(), m_theme->thumbRect(m_scrollbar).size());
m_theme->paintThumb(&context, m_scrollbar, thumbRect);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes