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

Side by Side Diff: Source/core/rendering/RenderTheme.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 * This file is part of the theme implementation for form controls in WebCore. 2 * This file is part of the theme implementation for form controls in WebCore.
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 extraParams.button.checked = isChecked(o); 1143 extraParams.button.checked = isChecked(o);
1144 extraParams.button.indeterminate = isIndeterminate(o); 1144 extraParams.button.indeterminate = isIndeterminate(o);
1145 1145
1146 float zoomLevel = o->style()->effectiveZoom(); 1146 float zoomLevel = o->style()->effectiveZoom();
1147 GraphicsContextStateSaver stateSaver(*i.context); 1147 GraphicsContextStateSaver stateSaver(*i.context);
1148 IntRect unzoomedRect = r; 1148 IntRect unzoomedRect = r;
1149 if (zoomLevel != 1) { 1149 if (zoomLevel != 1) {
1150 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); 1150 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
1151 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); 1151 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
1152 i.context->translate(unzoomedRect.x(), unzoomedRect.y()); 1152 i.context->translate(unzoomedRect.x(), unzoomedRect.y());
1153 i.context->scale(FloatSize(zoomLevel, zoomLevel)); 1153 i.context->scale(zoomLevel, zoomLevel);
1154 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); 1154 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
1155 } 1155 }
1156 1156
1157 blink::Platform::current()->fallbackThemeEngine()->paint(canvas, blink::WebF allbackThemeEngine::PartCheckbox, getWebFallbackThemeState(this, o), blink::WebR ect(unzoomedRect), &extraParams); 1157 blink::Platform::current()->fallbackThemeEngine()->paint(canvas, blink::WebF allbackThemeEngine::PartCheckbox, getWebFallbackThemeState(this, o), blink::WebR ect(unzoomedRect), &extraParams);
1158 return false; 1158 return false;
1159 } 1159 }
1160 1160
1161 void RenderTheme::adjustCheckboxStyleUsingFallbackTheme(RenderStyle* style, Elem ent*) const 1161 void RenderTheme::adjustCheckboxStyleUsingFallbackTheme(RenderStyle* style, Elem ent*) const
1162 { 1162 {
1163 // If the width and height are both specified, then we have nothing to do. 1163 // If the width and height are both specified, then we have nothing to do.
(...skipping 23 matching lines...) Expand all
1187 extraParams.button.checked = isChecked(o); 1187 extraParams.button.checked = isChecked(o);
1188 extraParams.button.indeterminate = isIndeterminate(o); 1188 extraParams.button.indeterminate = isIndeterminate(o);
1189 1189
1190 float zoomLevel = o->style()->effectiveZoom(); 1190 float zoomLevel = o->style()->effectiveZoom();
1191 GraphicsContextStateSaver stateSaver(*i.context); 1191 GraphicsContextStateSaver stateSaver(*i.context);
1192 IntRect unzoomedRect = r; 1192 IntRect unzoomedRect = r;
1193 if (zoomLevel != 1) { 1193 if (zoomLevel != 1) {
1194 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); 1194 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
1195 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); 1195 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
1196 i.context->translate(unzoomedRect.x(), unzoomedRect.y()); 1196 i.context->translate(unzoomedRect.x(), unzoomedRect.y());
1197 i.context->scale(FloatSize(zoomLevel, zoomLevel)); 1197 i.context->scale(zoomLevel, zoomLevel);
1198 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); 1198 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
1199 } 1199 }
1200 1200
1201 blink::Platform::current()->fallbackThemeEngine()->paint(canvas, blink::WebF allbackThemeEngine::PartRadio, getWebFallbackThemeState(this, o), blink::WebRect (unzoomedRect), &extraParams); 1201 blink::Platform::current()->fallbackThemeEngine()->paint(canvas, blink::WebF allbackThemeEngine::PartRadio, getWebFallbackThemeState(this, o), blink::WebRect (unzoomedRect), &extraParams);
1202 return false; 1202 return false;
1203 } 1203 }
1204 1204
1205 void RenderTheme::adjustRadioStyleUsingFallbackTheme(RenderStyle* style, Element *) const 1205 void RenderTheme::adjustRadioStyleUsingFallbackTheme(RenderStyle* style, Element *) const
1206 { 1206 {
1207 // If the width and height are both specified, then we have nothing to do. 1207 // If the width and height are both specified, then we have nothing to do.
1208 if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto()) 1208 if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
1209 return; 1209 return;
1210 1210
1211 IntSize size = blink::Platform::current()->fallbackThemeEngine()->getSize(bl ink::WebFallbackThemeEngine::PartRadio); 1211 IntSize size = blink::Platform::current()->fallbackThemeEngine()->getSize(bl ink::WebFallbackThemeEngine::PartRadio);
1212 float zoomLevel = style->effectiveZoom(); 1212 float zoomLevel = style->effectiveZoom();
1213 size.setWidth(size.width() * zoomLevel); 1213 size.setWidth(size.width() * zoomLevel);
1214 size.setHeight(size.height() * zoomLevel); 1214 size.setHeight(size.height() * zoomLevel);
1215 setSizeIfAuto(style, size); 1215 setSizeIfAuto(style, size);
1216 1216
1217 // padding - not honored by WinIE, needs to be removed. 1217 // padding - not honored by WinIE, needs to be removed.
1218 style->resetPadding(); 1218 style->resetPadding();
1219 1219
1220 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme) 1220 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
1221 // for now, we will not honor it. 1221 // for now, we will not honor it.
1222 style->resetBorder(); 1222 style->resetBorder();
1223 } 1223 }
1224 1224
1225 } // namespace WebCore 1225 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.cpp ('k') | Source/core/rendering/RenderThemeChromiumDefault.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698