Changeset 84042 in webkit
- Timestamp:
- Apr 15, 2011 3:31:29 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84039 r84042 1 2011-04-15 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Fade the find page overlay 6 https://bugs.webkit.org/show_bug.cgi?id=58697 7 8 Add a symbol that WebKit2 needs. 9 10 * WebCore.exp.in: 11 1 12 2011-04-15 MORITA Hajime <morrita@google.com> 2 13 -
trunk/Source/WebCore/WebCore.exp.in
r84029 r84042 540 540 __ZN7WebCore20UserGestureIndicatorD1Ev 541 541 __ZN7WebCore20protocolIsJavaScriptERKN3WTF6StringE 542 __ZN7WebCore20makeRGBA32FromFloatsEffff 542 543 __ZN7WebCore21BackForwardController11itemAtIndexEi 543 544 __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb -
trunk/Source/WebKit2/ChangeLog
r84036 r84042 1 2011-04-15 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Fade the find page overlay 6 https://bugs.webkit.org/show_bug.cgi?id=58697 7 8 * WebProcess/WebPage/FindController.cpp: 9 Make the color components floats. 10 11 (WebKit::overlayBackgroundColor): 12 (WebKit::holeShadowColor): 13 (WebKit::holeFillColor): 14 Add helper functions for returning the colors given the fraction faded in. 15 16 (WebKit::FindController::drawRect): 17 Use the new helper functions. 18 19 * WebProcess/WebPage/WebPage.cpp: 20 (WebKit::WebPage::installPageOverlay): 21 Start the fade animation unless we're replacing an already existing page overlay 22 with another. 23 1 24 2011-04-15 Anders Carlsson <andersca@apple.com> 2 25 -
trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp
r84034 r84042 271 271 static const float whiteFrameThickness = 1.0; 272 272 273 static const int overlayBackgroundRed = 25; 274 static const int overlayBackgroundGreen = 25; 275 static const int overlayBackgroundBlue = 25; 276 static const int overlayBackgroundAlpha = 63; 277 278 static Color overlayBackgroundColor() 279 { 280 return Color(overlayBackgroundRed, overlayBackgroundGreen, overlayBackgroundBlue, overlayBackgroundAlpha); 281 } 282 283 void FindController::drawRect(PageOverlay*, GraphicsContext& graphicsContext, const IntRect& dirtyRect) 284 { 273 static const float overlayBackgroundRed = 0.1; 274 static const float overlayBackgroundGreen = 0.1; 275 static const float overlayBackgroundBlue = 0.1; 276 static const float overlayBackgroundAlpha = 0.25; 277 278 static Color overlayBackgroundColor(float fractionFadedIn) 279 { 280 return Color(overlayBackgroundRed, overlayBackgroundGreen, overlayBackgroundBlue, overlayBackgroundAlpha * fractionFadedIn); 281 } 282 283 static Color holeShadowColor(float fractionFadedIn) 284 { 285 return Color(0.0f, 0.0f, 0.0f, fractionFadedIn); 286 } 287 288 static Color holeFillColor(float fractionFadedIn) 289 { 290 return Color(1.0f, 1.0f, 1.0f, fractionFadedIn); 291 } 292 293 void FindController::drawRect(PageOverlay* pageOverlay, GraphicsContext& graphicsContext, const IntRect& dirtyRect) 294 { 295 float fractionFadedIn = pageOverlay->fractionFadedIn(); 296 285 297 Vector<IntRect> rects = rectsForTextMatches(); 286 298 287 299 // Draw the background. 288 graphicsContext.fillRect(dirtyRect, overlayBackgroundColor( ), ColorSpaceSRGB);300 graphicsContext.fillRect(dirtyRect, overlayBackgroundColor(fractionFadedIn), ColorSpaceSRGB); 289 301 290 302 graphicsContext.save(); 291 graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, Color::black, ColorSpaceSRGB);292 293 graphicsContext.setFillColor( Color::white, ColorSpaceSRGB);303 graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, holeShadowColor(fractionFadedIn), ColorSpaceSRGB); 304 305 graphicsContext.setFillColor(holeFillColor(fractionFadedIn), ColorSpaceSRGB); 294 306 295 307 // Draw white frames around the holes. -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r84034 r84042 725 725 void WebPage::installPageOverlay(PassRefPtr<PageOverlay> pageOverlay) 726 726 { 727 if (m_pageOverlay) 728 pageOverlay->setPage(0); 727 bool shouldFadeIn = true; 728 729 if (m_pageOverlay) { 730 m_pageOverlay->setPage(0); 731 732 if (pageOverlay) { 733 // We're installing a page overlay when a page overlay is already active. 734 // In this case we don't want to fade in the new overlay. 735 shouldFadeIn = false; 736 } 737 } 729 738 730 739 m_pageOverlay = pageOverlay; 731 740 m_pageOverlay->setPage(this); 741 742 if (shouldFadeIn) 743 m_pageOverlay->startFadeInAnimation(); 744 732 745 m_drawingArea->didInstallPageOverlay(); 733 746 }
Note: See TracChangeset
for help on using the changeset viewer.