Diff
Modified: trunk/Source/WebCore/ChangeLog (124682 => 124683)
--- trunk/Source/WebCore/ChangeLog 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/ChangeLog 2012-08-04 01:39:31 UTC (rev 124683)
@@ -1,3 +1,32 @@
+2012-08-03 James Robinson <[email protected]>
+
+ [chromium] Stop relying on implicit WebFoo <-> WebCore conversion operators in compositor
+ https://bugs.webkit.org/show_bug.cgi?id=93169
+
+ Reviewed by Adrienne Walker.
+
+ This removes the compositor's reliance on implicit conversion operators from Web* types to WebKit-internal
+ types, specifically WebRect <-> WebCore::IntRect and WebString <-> WTF::String.
+
+ * platform/graphics/chromium/CanvasLayerTextureUpdater.cpp:
+ (WebCore::CanvasLayerTextureUpdater::paintContents):
+ * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp:
+ (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::getFramebufferPixels):
+ * platform/graphics/chromium/ScrollbarLayerChromium.cpp:
+ (WebCore::ScrollbarLayerChromium::setTexturePriorities):
+ (WebCore::ScrollbarLayerChromium::update):
+ * platform/graphics/chromium/cc/CCFontAtlas.cpp:
+ (WebCore::CCFontAtlas::drawOneLineOfTextInternal):
+ * platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp:
+ (WebCore::CCHeadsUpDisplayLayerImpl::drawFPSCounter):
+ (WebCore::CCHeadsUpDisplayLayerImpl::drawDebugRects):
+ * platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
+ (WebCore::toUVRect):
+ (WebCore::CCScrollbarLayerImpl::appendQuads):
+ (WebCore::CCScrollbarLayerImpl::CCScrollbar::size):
+
2012-08-03 Michael Nordman <[email protected]>
[Chromium] Cross-thread-copy a couple more recently added ResourceResponse data members, apparently
Modified: trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp (124682 => 124683)
--- trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.cpp 2012-08-04 01:39:31 UTC (rev 124683)
@@ -70,8 +70,9 @@
SkPaint paint;
paint.setAntiAlias(false);
paint.setXfermodeMode(SkXfermode::kClear_Mode);
- canvas->drawRect(layerRect, paint);
- canvas->clipRect(layerRect);
+ SkRect layerSkRect = SkRect::MakeXYWH(layerRect.x(), layerRect.y(), layerRect.width(), layerRect.height());
+ canvas->drawRect(layerSkRect, paint);
+ canvas->clipRect(layerSkRect);
FloatRect opaqueLayerRect;
double paintBeginTime = monotonicallyIncreasingTime();
Modified: trunk/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp (124682 => 124683)
--- trunk/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp 2012-08-04 01:39:31 UTC (rev 124683)
@@ -117,7 +117,7 @@
canvas->translate(0.0, texture->size().height());
canvas->scale(1.0, -1.0);
// Only the region corresponding to destRect on the texture must be updated.
- canvas->clipRect(SkRect(destRect));
+ canvas->clipRect(SkRect::MakeXYWH(destRect.x(), destRect.y(), destRect.width(), destRect.height()));
// Translate the origin of contentRect to that of destRect.
// Note that destRect is defined relative to sourceRect.
canvas->translate(contentRect().x() - sourceRect.x() + destRect.x(),
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (124682 => 124683)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp 2012-08-04 01:39:31 UTC (rev 124683)
@@ -1309,8 +1309,8 @@
bool doWorkaround = needsIOSurfaceReadbackWorkaround();
- Platform3DObject temporaryTexture = NullPlatform3DObject;
- Platform3DObject temporaryFBO = NullPlatform3DObject;
+ Platform3DObject temporaryTexture = 0;
+ Platform3DObject temporaryFBO = 0;
if (doWorkaround) {
// On Mac OS X, calling glReadPixels against an FBO whose color attachment is an
Modified: trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp (124682 => 124683)
--- trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/platform/graphics/chromium/ScrollbarLayerChromium.cpp 2012-08-04 01:39:31 UTC (rev 124683)
@@ -94,7 +94,8 @@
{
WebKit::WebCanvas* canvas = skCanvas;
// The following is a simplification of ScrollbarThemeComposite::paint.
- m_painter.paintScrollbarBackground(canvas, m_scrollbar, contentRect);
+ WebKit::WebRect contentWebRect(contentRect.x(), contentRect.y(), contentRect.width(), contentRect.height());
+ m_painter.paintScrollbarBackground(canvas, m_scrollbar, contentWebRect);
if (m_geometry.hasButtons(m_scrollbar)) {
WebRect backButtonStartPaintRect = m_geometry.backButtonStartRect(m_scrollbar);
@@ -246,8 +247,8 @@
m_foreTrack->texture()->setRequestPriority(CCPriorityCalculator::uiPriority(drawsToRoot));
}
if (m_thumb) {
- IntSize thumbSize = IntRect(m_geometry.thumbRect(m_scrollbar.get())).size();
- m_thumb->texture()->setDimensions(thumbSize, m_textureFormat);
+ WebKit::WebRect thumbRect = m_geometry.thumbRect(m_scrollbar.get());
+ m_thumb->texture()->setDimensions(IntSize(thumbRect.width, thumbRect.height), m_textureFormat);
m_thumb->texture()->setRequestPriority(CCPriorityCalculator::uiPriority(drawsToRoot));
}
}
@@ -259,16 +260,17 @@
createTextureUpdaterIfNeeded();
- IntPoint scrollbarOrigin(m_scrollbar->location());
+ IntPoint scrollbarOrigin(m_scrollbar->location().x, m_scrollbar->location().y);
IntRect contentRect(scrollbarOrigin, contentBounds());
updatePart(m_backTrackUpdater.get(), m_backTrack.get(), contentRect, updater, stats);
if (m_foreTrack && m_foreTrackUpdater)
updatePart(m_foreTrackUpdater.get(), m_foreTrack.get(), contentRect, updater, stats);
// Consider the thumb to be at the origin when painting.
- IntRect thumbRect = IntRect(IntPoint(), IntRect(m_geometry.thumbRect(m_scrollbar.get())).size());
- if (!thumbRect.isEmpty())
- updatePart(m_thumbUpdater.get(), m_thumb.get(), thumbRect, updater, stats);
+ WebKit::WebRect thumbRect = m_geometry.thumbRect(m_scrollbar.get());
+ IntRect originThumbRect = IntRect(0, 0, thumbRect.width, thumbRect.height);
+ if (!originThumbRect.isEmpty())
+ updatePart(m_thumbUpdater.get(), m_thumb.get(), originThumbRect, updater, stats);
}
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp (124682 => 124683)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCFontAtlas.cpp 2012-08-04 01:39:31 UTC (rev 124683)
@@ -71,7 +71,7 @@
// If the ASCII code is out of bounds, then index 0 is used, which is just a plain rectangle glyph.
int asciiIndex = (textLine[i] < 128) ? textLine[i] : 0;
IntRect glyphBounds = m_asciiToRectTable[asciiIndex];
- SkIRect source = glyphBounds;
+ SkIRect source = SkIRect::MakeXYWH(glyphBounds.x(), glyphBounds.y(), glyphBounds.width(), glyphBounds.height());
canvas->drawBitmapRect(m_atlas, &source, SkRect::MakeXYWH(position.x(), position.y(), glyphBounds.width(), glyphBounds.height()));
position.setX(position.x() + glyphBounds.width());
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp (124682 => 124683)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplayLayerImpl.cpp 2012-08-04 01:39:31 UTC (rev 124683)
@@ -187,7 +187,7 @@
p = 1;
// Plot this data point.
- IntPoint cur(graphLeft + x, 1 + top + p*h);
+ SkPoint cur = SkPoint::Make(graphLeft + x, 1 + top + p*h);
if (path.isEmpty())
path.moveTo(cur);
else
@@ -257,15 +257,16 @@
break;
}
- SkRect rect = debugRects[i].rect;
+ const FloatRect& rect = debugRects[i].rect;
+ SkRect skRect = SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height());
SkPaint paint;
paint.setColor(fillColor);
- canvas->drawRect(rect, paint);
+ canvas->drawRect(skRect, paint);
paint.setColor(strokeColor);
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(2);
- canvas->drawRect(rect, paint);
+ canvas->drawRect(skRect, paint);
}
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp (124682 => 124683)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp 2012-08-04 01:28:22 UTC (rev 124682)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp 2012-08-04 01:39:31 UTC (rev 124683)
@@ -80,10 +80,10 @@
scrollbar->getTickmarks(m_tickmarks);
}
-static FloatRect toUVRect(const WebRect& r, const WebRect& bounds)
+static FloatRect toUVRect(const WebRect& r, const IntRect& bounds)
{
- return FloatRect(static_cast<float>(r.x) / bounds.width, static_cast<float>(r.y) / bounds.height,
- static_cast<float>(r.width) / bounds.width, static_cast<float>(r.height) / bounds.height);
+ return FloatRect(static_cast<float>(r.x) / bounds.width(), static_cast<float>(r.y) / bounds.height(),
+ static_cast<float>(r.width) / bounds.width(), static_cast<float>(r.height) / bounds.height());
}
void CCScrollbarLayerImpl::scrollbarGeometry(WebRect& thumbRect, WebRect& backTrackRect, WebRect& foreTrackRect)
@@ -104,7 +104,7 @@
scrollbarGeometry(thumbRect, backTrackRect, foreTrackRect);
if (m_thumbResourceId && !thumbRect.isEmpty()) {
- OwnPtr<CCTextureDrawQuad> quad = CCTextureDrawQuad::create(sharedQuadState, IntRect(thumbRect), m_thumbResourceId, premultipledAlpha, uvRect, flipped);
+ OwnPtr<CCTextureDrawQuad> quad = CCTextureDrawQuad::create(sharedQuadState, IntRect(thumbRect.x, thumbRect.y, thumbRect.width, thumbRect.height), m_thumbResourceId, premultipledAlpha, uvRect, flipped);
quad->setNeedsBlending();
quadList.append(quad.release());
}
@@ -114,7 +114,7 @@
// We only paint the track in two parts if we were given a texture for the forward track part.
if (m_foreTrackResourceId && !foreTrackRect.isEmpty())
- quadList.append(CCTextureDrawQuad::create(sharedQuadState, IntRect(foreTrackRect), m_foreTrackResourceId, premultipledAlpha, toUVRect(foreTrackRect, boundsRect), flipped));
+ quadList.append(CCTextureDrawQuad::create(sharedQuadState, IntRect(foreTrackRect.x, foreTrackRect.y, foreTrackRect.width, foreTrackRect.height), m_foreTrackResourceId, premultipledAlpha, toUVRect(foreTrackRect, boundsRect), flipped));
// Order matters here: since the back track texture is being drawn to the entire contents rect, we must append it after the thumb and
// fore track quads. The back track texture contains (and displays) the buttons.
@@ -146,7 +146,7 @@
WebKit::WebSize CCScrollbarLayerImpl::CCScrollbar::size() const
{
- return m_owner->contentBounds();
+ return WebKit::WebSize(m_owner->contentBounds().width(), m_owner->contentBounds().height());
}
bool CCScrollbarLayerImpl::CCScrollbar::enabled() const