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

Side by Side Diff: Source/core/rendering/RenderWidget.cpp

Issue 23509003: Address regression bug report, revert the PaintInfo rect member function. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Including revision in cl. Created 7 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 unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderView.cpp ('k') | Source/core/rendering/svg/SVGRenderSupport.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO ffset) 223 void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO ffset)
224 { 224 {
225 LayoutPoint adjustedPaintOffset = paintOffset + location(); 225 LayoutPoint adjustedPaintOffset = paintOffset + location();
226 226
227 // Tell the widget to paint now. This is the only time the widget is allowed 227 // Tell the widget to paint now. This is the only time the widget is allowed
228 // to paint itself. That way it will composite properly with z-indexed layer s. 228 // to paint itself. That way it will composite properly with z-indexed layer s.
229 IntPoint widgetLocation = m_widget->frameRect().location(); 229 IntPoint widgetLocation = m_widget->frameRect().location();
230 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p addingLeft()), 230 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p addingLeft()),
231 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop())); 231 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop()));
232 IntRect paintRect = paintInfo.rect(); 232 IntRect paintRect = paintInfo.rect;
233 233
234 IntSize widgetPaintOffset = paintLocation - widgetLocation; 234 IntSize widgetPaintOffset = paintLocation - widgetLocation;
235 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer, 235 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer,
236 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing. 236 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing.
237 if (!widgetPaintOffset.isZero()) { 237 if (!widgetPaintOffset.isZero()) {
238 paintInfo.context->translate(widgetPaintOffset); 238 paintInfo.context->translate(widgetPaintOffset);
239 paintRect.move(-widgetPaintOffset); 239 paintRect.move(-widgetPaintOffset);
240 } 240 }
241 m_widget->paint(paintInfo.context, paintRect); 241 m_widget->paint(paintInfo.context, paintRect);
242 242
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 if (style()->hasBorderRadius()) 295 if (style()->hasBorderRadius())
296 paintInfo.context->restore(); 296 paintInfo.context->restore();
297 297
298 // Paint a partially transparent wash over selected widgets. 298 // Paint a partially transparent wash over selected widgets.
299 if (isSelected() && !document()->printing()) { 299 if (isSelected() && !document()->printing()) {
300 // FIXME: selectionRect() is in absolute, not painting coordinates. 300 // FIXME: selectionRect() is in absolute, not painting coordinates.
301 paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), select ionBackgroundColor()); 301 paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), select ionBackgroundColor());
302 } 302 }
303 303
304 if (hasLayer() && layer()->canResize()) 304 if (hasLayer() && layer()->canResize())
305 layer()->paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOf fset), paintInfo.rect()); 305 layer()->paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOf fset), paintInfo.rect);
306 } 306 }
307 307
308 void RenderWidget::setIsOverlapped(bool isOverlapped) 308 void RenderWidget::setIsOverlapped(bool isOverlapped)
309 { 309 {
310 ASSERT(m_widget); 310 ASSERT(m_widget);
311 ASSERT(m_widget->isFrameView()); 311 ASSERT(m_widget->isFrameView());
312 toFrameView(m_widget.get())->setIsOverlapped(isOverlapped); 312 toFrameView(m_widget.get())->setIsOverlapped(isOverlapped);
313 } 313 }
314 314
315 void RenderWidget::deref() 315 void RenderWidget::deref()
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor ) const 374 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor ) const
375 { 375 {
376 if (widget() && widget()->isPluginView()) { 376 if (widget() && widget()->isPluginView()) {
377 // A plug-in is responsible for setting the cursor when the pointer is o ver it. 377 // A plug-in is responsible for setting the cursor when the pointer is o ver it.
378 return DoNotSetCursor; 378 return DoNotSetCursor;
379 } 379 }
380 return RenderReplaced::getCursor(point, cursor); 380 return RenderReplaced::getCursor(point, cursor);
381 } 381 }
382 382
383 } // namespace WebCore 383 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderView.cpp ('k') | Source/core/rendering/svg/SVGRenderSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698