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

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

Issue 323013004: Clean up transform methods in GraphicsContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2nd Attempt Mac build fix Created 6 years, 6 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
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // to paint itself. That way it will composite properly with z-indexed layer s. 162 // to paint itself. That way it will composite properly with z-indexed layer s.
163 IntPoint widgetLocation = widget->frameRect().location(); 163 IntPoint widgetLocation = widget->frameRect().location();
164 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p addingLeft()), 164 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + borderLeft() + p addingLeft()),
165 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop())); 165 roundToInt(adjustedPaintOffset.y() + borderTop() + paddingTop()));
166 IntRect paintRect = paintInfo.rect; 166 IntRect paintRect = paintInfo.rect;
167 167
168 IntSize widgetPaintOffset = paintLocation - widgetLocation; 168 IntSize widgetPaintOffset = paintLocation - widgetLocation;
169 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer, 169 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer,
170 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing. 170 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing.
171 if (!widgetPaintOffset.isZero()) { 171 if (!widgetPaintOffset.isZero()) {
172 paintInfo.context->translate(widgetPaintOffset); 172 paintInfo.context->translate(widgetPaintOffset.width(), widgetPaintOffse t.height());
173 paintRect.move(-widgetPaintOffset); 173 paintRect.move(-widgetPaintOffset);
174 } 174 }
175 widget->paint(paintInfo.context, paintRect); 175 widget->paint(paintInfo.context, paintRect);
176 176
177 if (!widgetPaintOffset.isZero()) 177 if (!widgetPaintOffset.isZero())
178 paintInfo.context->translate(-widgetPaintOffset); 178 paintInfo.context->translate(-widgetPaintOffset.width(), -widgetPaintOff set.height());
179 179
180 if (widget->isFrameView()) { 180 if (widget->isFrameView()) {
181 FrameView* frameView = toFrameView(widget); 181 FrameView* frameView = toFrameView(widget);
182 bool runOverlapTests = !frameView->useSlowRepaintsIfNotOverlapped() || f rameView->hasCompositedContent(); 182 bool runOverlapTests = !frameView->useSlowRepaintsIfNotOverlapped() || f rameView->hasCompositedContent();
183 if (paintInfo.overlapTestRequests && runOverlapTests) { 183 if (paintInfo.overlapTestRequests && runOverlapTests) {
184 ASSERT(!paintInfo.overlapTestRequests->contains(this)); 184 ASSERT(!paintInfo.overlapTestRequests->contains(this));
185 paintInfo.overlapTestRequests->set(this, widget->frameRect()); 185 paintInfo.overlapTestRequests->set(this, widget->frameRect());
186 } 186 }
187 } 187 }
188 } 188 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor ) const 315 CursorDirective RenderWidget::getCursor(const LayoutPoint& point, Cursor& cursor ) const
316 { 316 {
317 if (widget() && widget()->isPluginView()) { 317 if (widget() && widget()->isPluginView()) {
318 // A plug-in is responsible for setting the cursor when the pointer is o ver it. 318 // A plug-in is responsible for setting the cursor when the pointer is o ver it.
319 return DoNotSetCursor; 319 return DoNotSetCursor;
320 } 320 }
321 return RenderReplaced::getCursor(point, cursor); 321 return RenderReplaced::getCursor(point, cursor);
322 } 322 }
323 323
324 } // namespace WebCore 324 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumSkia.cpp ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698