Title: [125625] trunk/Source/WebKit/chromium
- Revision
- 125625
- Author
- [email protected]
- Date
- 2012-08-14 17:33:21 -0700 (Tue, 14 Aug 2012)
Log Message
[Chromium] Fix warnings on Windows build
https://bugs.webkit.org/show_bug.cgi?id=93997
Patch by Scott Graham <[email protected]> on 2012-08-14
Reviewed by Kentaro Hara.
Fixes truncation from 'double' to 'float' warnings on Chromium Windows
build.
* tests/CCRenderSurfaceFiltersTest.cpp:
(WebKit::TEST):
* tests/CCScrollbarAnimationControllerLinearFadeTest.cpp:
(WebCore::TEST_F):
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (125624 => 125625)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-08-15 00:10:36 UTC (rev 125624)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-08-15 00:33:21 UTC (rev 125625)
@@ -1,3 +1,18 @@
+2012-08-14 Scott Graham <[email protected]>
+
+ [Chromium] Fix warnings on Windows build
+ https://bugs.webkit.org/show_bug.cgi?id=93997
+
+ Reviewed by Kentaro Hara.
+
+ Fixes truncation from 'double' to 'float' warnings on Chromium Windows
+ build.
+
+ * tests/CCRenderSurfaceFiltersTest.cpp:
+ (WebKit::TEST):
+ * tests/CCScrollbarAnimationControllerLinearFadeTest.cpp:
+ (WebCore::TEST_F):
+
2012-08-14 Chris Rogers <[email protected]>
Implement new synchronized audio I/O render method in chromium
Modified: trunk/Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp (125624 => 125625)
--- trunk/Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp 2012-08-15 00:10:36 UTC (rev 125624)
+++ trunk/Source/WebKit/chromium/tests/CCRenderSurfaceFiltersTest.cpp 2012-08-15 00:33:21 UTC (rev 125625)
@@ -52,27 +52,30 @@
// Several filters should always combine for any amount between 0 and 1:
// grayscale, saturate, invert, contrast, opacity.
EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0.3)));
+ // Note that we use 0.3f to avoid "argument is truncated from 'double' to
+ // 'float'" warnings on Windows. 0.5 is exactly representable as a float, so
+ // there is no warning.
+ EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createGrayscaleFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createSaturateFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createInvertFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createContrastFilter(1)));
EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0)));
- EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0.3)));
+ EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0.3f)));
EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(0.5)));
EXPECT_TRUE(isCombined(WebFilterOperation::createOpacityFilter(1)));
Modified: trunk/Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp (125624 => 125625)
--- trunk/Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp 2012-08-15 00:10:36 UTC (rev 125624)
+++ trunk/Source/WebKit/chromium/tests/CCScrollbarAnimationControllerLinearFadeTest.cpp 2012-08-15 00:33:21 UTC (rev 125625)
@@ -84,9 +84,11 @@
m_scrollbarController->animate(3);
EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity());
m_scrollbarController->animate(4);
- EXPECT_FLOAT_EQ(2 / 3.0, m_scrollbarLayer->opacity());
+ // Note that we use 3.0f to avoid "argument is truncated from 'double' to
+ // 'float'" warnings on Windows.
+ EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(5);
- EXPECT_FLOAT_EQ(1 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
m_scrollLayer->setScrollDelta(IntSize(3, 3));
m_scrollbarController->updateScrollOffsetAtTime(m_scrollLayer.get(), 5);
m_scrollbarController->animate(6);
@@ -94,9 +96,9 @@
m_scrollbarController->animate(7);
EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity());
m_scrollbarController->animate(8);
- EXPECT_FLOAT_EQ(2 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(9);
- EXPECT_FLOAT_EQ(1 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(10);
EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
}
@@ -127,9 +129,9 @@
m_scrollbarController->animate(8);
EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity());
m_scrollbarController->animate(9);
- EXPECT_FLOAT_EQ(2 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(10);
- EXPECT_FLOAT_EQ(1 / 3.0, m_scrollbarLayer->opacity());
+ EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
m_scrollbarController->animate(11);
EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes