OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. |
5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) | 224 void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) |
225 { | 225 { |
226 LayoutPoint adjustedPaintOffset = paintOffset + location(); | 226 LayoutPoint adjustedPaintOffset = paintOffset + location(); |
227 | 227 |
228 // Tell the widget to paint now. This is the only time the widget is allowed | 228 // Tell the widget to paint now. This is the only time the widget is allowed |
229 // to paint itself. That way it will composite properly with z-indexed layer
s. | 229 // to paint itself. That way it will composite properly with z-indexed layer
s. |
230 IntPoint widgetLocation = m_widget->frameRect().location(); | 230 IntPoint widgetLocation = m_widget->frameRect().location(); |
231 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p
addingLeft()), | 231 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p
addingLeft()), |
232 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop())); | 232 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop())); |
233 IntRect paintRect = paintInfo.rect; | 233 IntRect paintRect = paintInfo.rect(); |
234 | 234 |
235 IntSize widgetPaintOffset = paintLocation - widgetLocation; | 235 IntSize widgetPaintOffset = paintLocation - widgetLocation; |
236 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, | 236 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, |
237 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plug-in drawing. | 237 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plug-in drawing. |
238 if (!widgetPaintOffset.isZero()) { | 238 if (!widgetPaintOffset.isZero()) { |
239 paintInfo.context->translate(widgetPaintOffset); | 239 paintInfo.context->translate(widgetPaintOffset); |
240 paintRect.move(-widgetPaintOffset); | 240 paintRect.move(-widgetPaintOffset); |
241 } | 241 } |
242 m_widget->paint(paintInfo.context, paintRect); | 242 m_widget->paint(paintInfo.context, paintRect); |
243 | 243 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (style()->hasBorderRadius()) | 296 if (style()->hasBorderRadius()) |
297 paintInfo.context->restore(); | 297 paintInfo.context->restore(); |
298 | 298 |
299 // Paint a partially transparent wash over selected widgets. | 299 // Paint a partially transparent wash over selected widgets. |
300 if (isSelected() && !document()->printing()) { | 300 if (isSelected() && !document()->printing()) { |
301 // FIXME: selectionRect() is in absolute, not painting coordinates. | 301 // FIXME: selectionRect() is in absolute, not painting coordinates. |
302 paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), select
ionBackgroundColor()); | 302 paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), select
ionBackgroundColor()); |
303 } | 303 } |
304 | 304 |
305 if (hasLayer() && layer()->canResize()) | 305 if (hasLayer() && layer()->canResize()) |
306 layer()->paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOf
fset), paintInfo.rect); | 306 layer()->paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOf
fset), paintInfo.rect()); |
307 } | 307 } |
308 | 308 |
309 void RenderWidget::setIsOverlapped(bool isOverlapped) | 309 void RenderWidget::setIsOverlapped(bool isOverlapped) |
310 { | 310 { |
311 ASSERT(m_widget); | 311 ASSERT(m_widget); |
312 ASSERT(m_widget->isFrameView()); | 312 ASSERT(m_widget->isFrameView()); |
313 toFrameView(m_widget.get())->setIsOverlapped(isOverlapped); | 313 toFrameView(m_widget.get())->setIsOverlapped(isOverlapped); |
314 } | 314 } |
315 | 315 |
316 void RenderWidget::deref() | 316 void RenderWidget::deref() |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor
) const | 375 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor
) const |
376 { | 376 { |
377 if (widget() && widget()->isPluginView()) { | 377 if (widget() && widget()->isPluginView()) { |
378 // A plug-in is responsible for setting the cursor when the pointer is o
ver it. | 378 // A plug-in is responsible for setting the cursor when the pointer is o
ver it. |
379 return DoNotSetCursor; | 379 return DoNotSetCursor; |
380 } | 380 } |
381 return RenderReplaced::getCursor(point, cursor); | 381 return RenderReplaced::getCursor(point, cursor); |
382 } | 382 } |
383 | 383 |
384 } // namespace WebCore | 384 } // namespace WebCore |
OLD | NEW |