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

Unified Diff: third_party/WebKit/Source/core/paint/ThemePainter.cpp

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/ThemePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/ThemePainter.cpp b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
index f93285c26636ec593d5cf2ce6ed3a9e0a646e2f5..63d9adde73b1979737a1de6d3a695d2be04dd0a0 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
@@ -76,7 +76,7 @@ bool ThemePainter::paint(const LayoutObject& o, const PaintInfo& paintInfo, cons
case SquareButtonPart:
case ButtonPart:
case InnerSpinButtonPart:
- platformTheme()->paint(part, LayoutTheme::controlStatesForLayoutObject(o), const_cast<GraphicsContext*>(paintInfo.context), r, o.styleRef().effectiveZoom(), o.view()->frameView());
+ platformTheme()->paint(part, LayoutTheme::controlStatesForLayoutObject(o), const_cast<GraphicsContext&>(paintInfo.context), r, o.styleRef().effectiveZoom(), o.view()->frameView());
return false;
default:
break;
@@ -314,7 +314,7 @@ void ThemePainter::paintSliderTicks(const LayoutObject& o, const PaintInfo& pain
tickRect.setX(tickPosition);
else
tickRect.setY(tickPosition);
- paintInfo.context->fillRect(tickRect, o.resolveColor(CSSPropertyColor));
+ paintInfo.context.fillRect(tickRect, o.resolveColor(CSSPropertyColor));
}
}
@@ -335,19 +335,19 @@ bool ThemePainter::paintUsingFallbackTheme(const LayoutObject& o, const PaintInf
bool ThemePainter::paintCheckboxUsingFallbackTheme(const LayoutObject& o, const PaintInfo& i, const IntRect&r)
{
WebFallbackThemeEngine::ExtraParams extraParams;
- WebCanvas* canvas = i.context->canvas();
+ WebCanvas* canvas = i.context.canvas();
extraParams.button.checked = LayoutTheme::isChecked(o);
extraParams.button.indeterminate = LayoutTheme::isIndeterminate(o);
float zoomLevel = o.styleRef().effectiveZoom();
- GraphicsContextStateSaver stateSaver(*i.context);
+ GraphicsContextStateSaver stateSaver(i.context);
IntRect unzoomedRect = r;
if (zoomLevel != 1) {
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
- i.context->translate(unzoomedRect.x(), unzoomedRect.y());
- i.context->scale(zoomLevel, zoomLevel);
- i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
+ i.context.translate(unzoomedRect.x(), unzoomedRect.y());
+ i.context.scale(zoomLevel, zoomLevel);
+ i.context.translate(-unzoomedRect.x(), -unzoomedRect.y());
}
Platform::current()->fallbackThemeEngine()->paint(canvas, WebFallbackThemeEngine::PartCheckbox, getWebFallbackThemeState(o), WebRect(unzoomedRect), &extraParams);
@@ -357,19 +357,19 @@ bool ThemePainter::paintCheckboxUsingFallbackTheme(const LayoutObject& o, const
bool ThemePainter::paintRadioUsingFallbackTheme(const LayoutObject& o, const PaintInfo& i, const IntRect&r)
{
WebFallbackThemeEngine::ExtraParams extraParams;
- WebCanvas* canvas = i.context->canvas();
+ WebCanvas* canvas = i.context.canvas();
extraParams.button.checked = LayoutTheme::isChecked(o);
extraParams.button.indeterminate = LayoutTheme::isIndeterminate(o);
float zoomLevel = o.styleRef().effectiveZoom();
- GraphicsContextStateSaver stateSaver(*i.context);
+ GraphicsContextStateSaver stateSaver(i.context);
IntRect unzoomedRect = r;
if (zoomLevel != 1) {
unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
- i.context->translate(unzoomedRect.x(), unzoomedRect.y());
- i.context->scale(zoomLevel, zoomLevel);
- i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
+ i.context.translate(unzoomedRect.x(), unzoomedRect.y());
+ i.context.scale(zoomLevel, zoomLevel);
+ i.context.translate(-unzoomedRect.x(), -unzoomedRect.y());
}
Platform::current()->fallbackThemeEngine()->paint(canvas, WebFallbackThemeEngine::PartRadio, getWebFallbackThemeState(o), WebRect(unzoomedRect), &extraParams);
« no previous file with comments | « third_party/WebKit/Source/core/paint/TextPainterTest.cpp ('k') | third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698