Reviewed by darin
* kcanvas/RenderForeignObject.cpp:
(WebCore::RenderForeignObject::paint):
* kcanvas/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::paint):
* kcanvas/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
* platform/GraphicsContext.h:
* platform/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::clip):
* platform/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::addRoundedRectClip):
(WebCore::GraphicsContext::addInnerRoundedRectClip):
(WebCore::GraphicsContext::scale):
(WebCore::GraphicsContext::rotate):
(WebCore::GraphicsContext::translate):
(WebCore::GraphicsContext::concatCTM):
* platform/cg/GraphicsContextPlatformPrivate.h:
(WebCore::GraphicsContextPlatformPrivate::save):
(WebCore::GraphicsContextPlatformPrivate::restore):
(WebCore::GraphicsContextPlatformPrivate::clip):
(WebCore::GraphicsContextPlatformPrivate::scale):
(WebCore::GraphicsContextPlatformPrivate::rotate):
(WebCore::GraphicsContextPlatformPrivate::translate):
(WebCore::GraphicsContextPlatformPrivate::concatCTM):
* platform/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::addInnerRoundedRectClip):
(WebCore::GraphicsContext::addRoundedRectClip):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBackground):
(WebCore::InlineFlowBox::paintBackgroundAndBorder):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::paintTextMatchMarker):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBackgroundExtended):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::paintObject):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::setClip):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintObject):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::paintObject):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16826
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-05 David Hyatt <hyatt@apple.com>
+
+ Rename addClip to clip.
+
+ Reviewed by darin
+
+ * kcanvas/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::paint):
+ * kcanvas/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::paint):
+ * kcanvas/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::paint):
+ * platform/GraphicsContext.h:
+ * platform/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::clip):
+ * platform/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::savePlatformState):
+ (WebCore::GraphicsContext::restorePlatformState):
+ (WebCore::GraphicsContext::clip):
+ (WebCore::GraphicsContext::addRoundedRectClip):
+ (WebCore::GraphicsContext::addInnerRoundedRectClip):
+ (WebCore::GraphicsContext::scale):
+ (WebCore::GraphicsContext::rotate):
+ (WebCore::GraphicsContext::translate):
+ (WebCore::GraphicsContext::concatCTM):
+ * platform/cg/GraphicsContextPlatformPrivate.h:
+ (WebCore::GraphicsContextPlatformPrivate::save):
+ (WebCore::GraphicsContextPlatformPrivate::restore):
+ (WebCore::GraphicsContextPlatformPrivate::clip):
+ (WebCore::GraphicsContextPlatformPrivate::scale):
+ (WebCore::GraphicsContextPlatformPrivate::rotate):
+ (WebCore::GraphicsContextPlatformPrivate::translate):
+ (WebCore::GraphicsContextPlatformPrivate::concatCTM):
+ * platform/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::clip):
+ (WebCore::GraphicsContext::addInnerRoundedRectClip):
+ (WebCore::GraphicsContext::addRoundedRectClip):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintBackground):
+ (WebCore::InlineFlowBox::paintBackgroundAndBorder):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paintSelection):
+ (WebCore::InlineTextBox::paintTextMatchMarker):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::paintBackgroundExtended):
+ * rendering/RenderButton.cpp:
+ (WebCore::RenderButton::paintObject):
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::paintObject):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::beginTransparencyLayers):
+ (WebCore::setClip):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::paintObject):
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::paintObject):
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::paintBackgroundsBehindCell):
+
2006-10-05 Mitz Pettel <mitz@webkit.org>
Reviewed by Darin.
context->concatCTM(localTransform());
context->concatCTM(translationForAttributes());
- paintInfo.p->addClip(getClipRect(parentX, parentY));
+ paintInfo.p->clip(getClipRect(parentX, parentY));
float opacity = style()->opacity();
if (opacity < 1.0f)
if (!viewport().isEmpty()) {
if (style()->overflowX() != OVISIBLE)
- paintInfo.p->addClip(enclosingIntRect(viewport())); // FIXME: Eventually we'll want float-precision clipping
+ paintInfo.p->clip(enclosingIntRect(viewport())); // FIXME: Eventually we'll want float-precision clipping
deviceContext->concatCTM(AffineTransform().translate(viewport().x(), viewport().y()));
}
float opacity = style()->opacity();
if (opacity < 1.0f) {
- paintInfo.p->addClip(enclosingIntRect(strokeBBox));
+ paintInfo.p->clip(enclosingIntRect(strokeBBox));
paintInfo.p->beginTransparencyLayer(opacity);
}
float opacity = style()->opacity();
if (opacity < 1.0f) {
- c->addClip(enclosingIntRect(boundingBox));
+ c->clip(enclosingIntRect(boundingBox));
c->beginTransparencyLayer(opacity);
}
Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
CompositeOperator = CompositeSourceOver);
- void addClip(const IntRect&);
+ void clip(const IntRect&);
void addRoundedRectClip(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight);
void addInnerRoundedRectClip(const IntRect&, int thickness);
fillRectSourceOver(m_data->context, rect, color);
}
-void GraphicsContext::addClip(const IntRect& rect)
+void GraphicsContext::clip(const IntRect& rect)
{
if (paintingDisabled())
return;
void GraphicsContext::savePlatformState()
{
+ // Note: Do not use this function within this class implementation, since we want to avoid the extra
+ // save of the secondary context (in GraphicsContextPlatformPrivate.h).
CGContextSaveGState(platformContext());
+ m_data->save();
}
void GraphicsContext::restorePlatformState()
{
+ // Note: Do not use this function within this class implementation, since we want to avoid the extra
+ // restore of the secondary context (in GraphicsContextPlatformPrivate.h).
CGContextRestoreGState(platformContext());
+ m_data->restore();
}
// Draws a filled rectangle with a stroked border.
}
}
-void GraphicsContext::addClip(const IntRect& rect)
+void GraphicsContext::clip(const IntRect& rect)
{
if (paintingDisabled())
return;
CGContextClipToRect(platformContext(), rect);
+ m_data->clip(rect);
}
void GraphicsContext::addRoundedRectClip(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight,
return;
// Clip to our rect.
- addClip(rect);
+ clip(rect);
// OK, the curves can fit.
CGContextRef context = platformContext();
if (paintingDisabled())
return;
- addClip(rect);
+ clip(rect);
CGContextRef context = platformContext();
// Add outer ellipse
CGContextBeginPath(context);
CGContextAddPath(context, path.platformPath());
CGContextClip(context);
+ m_data->clip(path);
}
void GraphicsContext::scale(const FloatSize& size)
if (paintingDisabled())
return;
CGContextScaleCTM(platformContext(), size.width(), size.height());
+ m_data->scale(size);
}
void GraphicsContext::rotate(float angle)
if (paintingDisabled())
return;
CGContextRotateCTM(platformContext(), angle);
+ m_data->rotate(angle);
}
void GraphicsContext::translate(float x, float y)
if (paintingDisabled())
return;
CGContextTranslateCTM(platformContext(), x, y);
+ m_data->translate(x, y);
}
void GraphicsContext::concatCTM(const AffineTransform& transform)
if (paintingDisabled())
return;
CGContextConcatCTM(platformContext(), transform);
+ m_data->concatCTM(transform);
}
FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect)
CGContextRelease(m_cgContext);
}
+ void save() {}
+ void restore() {}
+
+ void clip(const IntRect&) {}
+ void clip(const Path&) {}
+
+ void scale(const FloatSize&) {}
+ void rotate(float) {}
+ void translate(float, float) {}
+ void concatCTM(const AffineTransform&) {}
+
CGContextRef m_cgContext;
IntRect m_focusRingClip; // Work around CG bug in focus ring clipping.
};
m_data->p().fillRect(rect, QColor(c));
}
-void GraphicsContext::addClip(const IntRect& rect)
+void GraphicsContext::clip(const IntRect& rect)
{
if (paintingDisabled())
return;
if (paintingDisabled())
return;
- addClip(rect);
+ clip(rect);
QPainterPath path;
// Add outer ellipse
return;
// Clip to our rect.
- addClip(rect);
+ clip(rect);
// OK, the curves can fit.
QPainterPath path;
for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
totalWidth += curr->width();
p->save();
- p->addClip(IntRect(_tx, _ty, width(), height()));
+ p->clip(IntRect(_tx, _ty, width(), height()));
object()->paintBackgroundExtended(p, c, bgLayer, my, mh, startX, _ty,
totalWidth, h, borderLeft(), borderRight(), paddingLeft(), paddingRight());
p->restore();
for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
totalWidth += curr->width();
p->save();
- p->addClip(IntRect(_tx, _ty, width(), height()));
+ p->clip(IntRect(_tx, _ty, width(), height()));
object()->paintBorder(p, startX, _ty, totalWidth, h, object()->style());
p->restore();
}
RootInlineBox* r = root();
int y = r->selectionTop();
int h = r->selectionHeight();
- p->addClip(IntRect(m_x + tx, y + ty, m_width, h));
+ p->clip(IntRect(m_x + tx, y + ty, m_width, h));
p->drawHighlightForText(TextRun(textObject()->string(), m_start, m_len, sPos, ePos), IntPoint(m_x + tx, y + ty), h,
TextStyle(textObject()->tabWidth(), textPos(), m_toAdd, m_reversed, m_dirOverride || style->visuallyOrdered()), c);
p->restore();
Color yellow = Color(255, 255, 0);
pt->save();
pt->setPen(yellow); // Don't draw text at all!
- pt->addClip(IntRect(_tx + m_x, _ty + y, m_width, h));
+ pt->clip(IntRect(_tx + m_x, _ty + y, m_width, h));
pt->drawHighlightForText(run, startPoint, h, renderStyle, yellow);
pt->restore();
}
int width = w - bleft - bright - (includePadding ? pleft + pright : 0);
int height = h - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : 0);
p->save();
- p->addClip(IntRect(x, y, width, height));
+ p->clip(IntRect(x, y, width, height));
}
CachedImage* bg = bgLayer->backgroundImage();
if (clipRect.width() == 0 || clipRect.height() == 0)
return;
i.p->save();
- i.p->addClip(clipRect);
+ i.p->clip(clipRect);
}
// Paint the children.
if (clipRect.width() == 0 || clipRect.height() == 0)
return;
i.p->save();
- i.p->addClip(clipRect);
+ i.p->clip(clipRect);
}
if (i.phase == PaintPhaseForeground) {
IntRect clipRect = transparencyClipBox(this);
clipRect.intersect(paintDirtyRect);
p->save();
- p->addClip(clipRect);
+ p->clip(clipRect);
p->beginTransparencyLayer(renderer()->opacity());
}
}
if (paintDirtyRect == clipRect)
return;
p->save();
- p->addClip(clipRect);
+ p->clip(clipRect);
}
static void restoreClip(GraphicsContext* p, const IntRect& paintDirtyRect, const IntRect& clipRect)
if (clipRect.width() == 0 || clipRect.height() == 0)
return;
i.p->save();
- i.p->addClip(clipRect);
+ i.p->clip(clipRect);
}
HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node());
if (clipRect.isEmpty())
return;
i.p->save();
- i.p->addClip(clipRect);
+ i.p->clip(clipRect);
}
// Paint the children.
IntRect clipRect(_tx + borderLeft(), _ty + borderTop(),
w - borderLeft() - borderRight(), h - borderTop() - borderBottom());
i.p->save();
- i.p->addClip(clipRect);
+ i.p->clip(clipRect);
}
paintBackground(i.p, c, bgLayer, my, mh, _tx, _ty, w, h);
if (hasLayer && tableElt->collapseBorders())