Commit c82dfa31 authored by fmalita@chromium.org's avatar fmalita@chromium.org

Use the stateless GC::fillRect variant when possible.

This reduces deferred paint save pressure and allows us to remove a
couple of GC state savers.

R=schenney@chromium.org,senorblanco@chromium.org
TBR=esprehn@chromium.org
BUG=424655

Review URL: https://codereview.chromium.org/671813002

git-svn-id: svn://svn.chromium.org/blink/trunk@184318 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e935ac3a
......@@ -138,8 +138,7 @@ void LayerPainter::beginTransparencyLayers(GraphicsContext* context, const Rende
if (m_renderLayer.paintsWithBlendMode())
context->setCompositeOperation(context->compositeOperation(), WebBlendModeNormal);
#ifdef REVEAL_TRANSPARENCY_LAYERS
context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f));
context->fillRect(clipRect);
context->fillRect(clipRect, Color(0.0f, 0.0f, 0.5f, 0.2f));
#endif
}
}
......
......@@ -875,8 +875,6 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
tickRegionWidth = trackBounds.height() - thumbSize.width();
}
RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->options();
GraphicsContextStateSaver stateSaver(*paintInfo.context);
paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor));
for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i); i++) {
String value = optionElement->value();
if (!input->isValidValue(value))
......@@ -889,7 +887,7 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
tickRect.setX(tickPosition);
else
tickRect.setY(tickPosition);
paintInfo.context->fillRect(tickRect);
paintInfo.context->fillRect(tickRect, o->resolveColor(CSSPropertyColor));
}
}
......
......@@ -116,13 +116,11 @@ void ScrollbarThemeNonMacCommon::paintTickmarks(GraphicsContext* context, Scroll
// Calculate how far down (in pixels) the tick-mark should appear.
const int yPos = rect.y() + (rect.height() * percent);
context->setFillColor(Color(0xCC, 0xAA, 0x00, 0xFF));
FloatRect tickRect(rect.x(), yPos, rect.width(), 3);
context->fillRect(tickRect);
context->fillRect(tickRect, Color(0xCC, 0xAA, 0x00, 0xFF));
context->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF));
FloatRect tickStroke(rect.x(), yPos + 1, rect.width(), 1);
context->fillRect(tickStroke);
context->fillRect(tickStroke, Color(0xFF, 0xDD, 0x00, 0xFF));
}
}
......
......@@ -353,8 +353,7 @@ public:
int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1;
// Fill the whole background by white.
graphicsContext.setFillColor(Color::white);
graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight));
graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight), Color::white);
int currentHeight = 0;
for (size_t pageIndex = 0; pageIndex < numPages; pageIndex++) {
......
......@@ -662,11 +662,9 @@ void WebPluginContainerImpl::willEndLiveResize()
bool WebPluginContainerImpl::paintCustomOverhangArea(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
{
context->save();
context->setFillColor(Color(0xCC, 0xCC, 0xCC));
context->fillRect(intersection(horizontalOverhangArea, dirtyRect));
context->fillRect(intersection(verticalOverhangArea, dirtyRect));
context->restore();
Color fillColor(0xCC, 0xCC, 0xCC);
context->fillRect(intersection(horizontalOverhangArea, dirtyRect), fillColor);
context->fillRect(intersection(verticalOverhangArea, dirtyRect), fillColor);
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment