Changeset 84523 in webkit
- Timestamp:
- Apr 21, 2011 10:57:36 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r84519 r84523 1 2011-04-21 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Simon Fraser. 4 5 Deploy GraphicsContextStateSaver in WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=59116 7 8 * UIProcess/FindIndicator.cpp: 9 (WebKit::FindIndicator::draw): 10 * WebProcess/Plugins/PluginView.cpp: 11 (WebKit::PluginView::paint): 12 * WebProcess/WebPage/FindController.cpp: 13 (WebKit::FindController::drawRect): 14 * WebProcess/WebPage/PageOverlay.cpp: 15 (WebKit::PageOverlay::drawRect): 16 * WebProcess/WebPage/WebPage.cpp: 17 (WebKit::WebPage::drawRect): 18 (WebKit::WebPage::drawPageOverlay): 19 1 20 2011-04-21 Jessie Berlin <jberlin@apple.com> 2 21 -
trunk/Source/WebKit2/UIProcess/FindIndicator.cpp
r82441 r84523 149 149 textRect.move(leftBorderThickness, topBorderThickness); 150 150 151 graphicsContext.save();152 151 FloatRect outerPathRect = inflateRect(textRect, horizontalOutsetToCenterOfLightBorder, verticalOutsetToCenterOfLightBorder); 153 graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), ColorSpaceSRGB); 154 graphicsContext.setFillColor(lightBorderColor(), ColorSpaceDeviceRGB); 155 graphicsContext.fillPath(pathWithRoundedRect(outerPathRect, cornerRadius)); 156 graphicsContext.restore(); 152 FloatRect innerPathRect = inflateRect(textRect, horizontalPaddingInsideLightBorder, verticalPaddingInsideLightBorder); 157 153 158 graphicsContext.save(); 159 FloatRect innerPathRect = inflateRect(textRect, horizontalPaddingInsideLightBorder, verticalPaddingInsideLightBorder); 160 graphicsContext.clip(pathWithRoundedRect(innerPathRect, cornerRadius)); 161 RefPtr<Gradient> gradient = Gradient::create(FloatPoint(innerPathRect.x(), innerPathRect.y()), FloatPoint(innerPathRect.x(), innerPathRect.maxY())); 162 gradient->addColorStop(0, gradientLightColor()); 163 gradient->addColorStop(1, gradientDarkColor()); 164 graphicsContext.setFillGradient(gradient); 165 graphicsContext.fillRect(outerPathRect); 166 graphicsContext.restore(); 154 { 155 GraphicsContextStateSaver stateSaver(graphicsContext); 156 graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), ColorSpaceSRGB); 157 graphicsContext.setFillColor(lightBorderColor(), ColorSpaceDeviceRGB); 158 graphicsContext.fillPath(pathWithRoundedRect(outerPathRect, cornerRadius)); 159 } 167 160 168 graphicsContext.save(); 169 graphicsContext.translate(FloatSize(roundf(leftBorderThickness), roundf(topBorderThickness))); 170 m_contentImage->paint(graphicsContext, IntPoint(0, 0), m_contentImage->bounds()); 171 graphicsContext.restore(); 161 { 162 GraphicsContextStateSaver stateSaver(graphicsContext); 163 graphicsContext.clip(pathWithRoundedRect(innerPathRect, cornerRadius)); 164 RefPtr<Gradient> gradient = Gradient::create(FloatPoint(innerPathRect.x(), innerPathRect.y()), FloatPoint(innerPathRect.x(), innerPathRect.maxY())); 165 gradient->addColorStop(0, gradientLightColor()); 166 gradient->addColorStop(1, gradientDarkColor()); 167 graphicsContext.setFillGradient(gradient); 168 graphicsContext.fillRect(outerPathRect); 169 } 170 171 { 172 GraphicsContextStateSaver stateSaver(graphicsContext); 173 graphicsContext.translate(FloatSize(roundf(leftBorderThickness), roundf(topBorderThickness))); 174 m_contentImage->paint(graphicsContext, IntPoint(0, 0), m_contentImage->bounds()); 175 } 172 176 } 173 177 } -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r82467 r84523 532 532 // the document's window coordinates. 533 533 IntPoint documentOriginInWindowCoordinates = parent()->contentsToWindow(IntPoint()); 534 context->save(); 534 535 GraphicsContextStateSaver stateSaver(*context); 535 536 context->translate(-documentOriginInWindowCoordinates.x(), -documentOriginInWindowCoordinates.y()); 536 537 m_plugin->paint(context, paintRectInWindowCoordinates); 537 context->restore();538 538 } 539 539 } -
trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp
r84042 r84523 300 300 graphicsContext.fillRect(dirtyRect, overlayBackgroundColor(fractionFadedIn), ColorSpaceSRGB); 301 301 302 graphicsContext.save();303 graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, holeShadowColor(fractionFadedIn), ColorSpaceSRGB);304 305 graphicsContext.setFillColor(holeFillColor(fractionFadedIn), ColorSpaceSRGB);306 307 // Draw white frames around the holes. 308 for (size_t i = 0; i < rects.size(); ++i) {309 IntRect whiteFrameRect = rects[i];310 whiteFrameRect.inflate(1);311 312 graphicsContext.fillRect(whiteFrameRect); 313 }314 315 graphicsContext.restore();302 { 303 GraphicsContextStateSaver stateSaver(graphicsContext); 304 305 graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, holeShadowColor(fractionFadedIn), ColorSpaceSRGB); 306 graphicsContext.setFillColor(holeFillColor(fractionFadedIn), ColorSpaceSRGB); 307 308 // Draw white frames around the holes. 309 for (size_t i = 0; i < rects.size(); ++i) { 310 IntRect whiteFrameRect = rects[i]; 311 whiteFrameRect.inflate(1); 312 313 graphicsContext.fillRect(whiteFrameRect); 314 } 315 } 316 316 317 317 graphicsContext.setFillColor(Color::transparent, ColorSpaceSRGB); -
trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp
r84153 r84523 105 105 return; 106 106 107 graphicsContext.save();107 GraphicsContextStateSaver stateSaver(graphicsContext); 108 108 graphicsContext.beginTransparencyLayer(1); 109 109 graphicsContext.setCompositeOperation(CompositeCopy); … … 112 112 113 113 graphicsContext.endTransparencyLayer(); 114 graphicsContext.restore();115 114 } 116 115 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r84519 r84523 642 642 void WebPage::drawRect(GraphicsContext& graphicsContext, const IntRect& rect) 643 643 { 644 graphicsContext.save();644 GraphicsContextStateSaver stateSaver(graphicsContext); 645 645 graphicsContext.clip(rect); 646 646 m_mainFrame->coreFrame()->view()->paint(&graphicsContext, rect); 647 graphicsContext.restore();648 647 } 649 648 … … 652 651 ASSERT(m_pageOverlay); 653 652 654 graphicsContext.save();653 GraphicsContextStateSaver stateSaver(graphicsContext); 655 654 graphicsContext.clip(rect); 656 655 m_pageOverlay->drawRect(graphicsContext, rect); 657 graphicsContext.restore();658 656 } 659 657
Note: See TracChangeset
for help on using the changeset viewer.