Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (94603 => 94604)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-09-06 22:19:28 UTC (rev 94603)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-09-06 22:19:47 UTC (rev 94604)
@@ -1,5 +1,19 @@
2011-09-06 Adam Barth <[email protected]>
+ [Chromium] Add WebFloatQuad.h for Android
+ https://bugs.webkit.org/show_bug.cgi?id=67573
+
+ Reviewed by Darin Fisher.
+
+ Android uses this wrapper of WebCore::FloatQuad in some API methods
+ (which will appear in subsequent patches).
+
+ * WebKit.gyp:
+ * public/WebFloatQuad.h: Added.
+ * src/WebFloatQuad.cpp: Added.
+
+2011-09-06 Adam Barth <[email protected]>
+
[Chromium] Add didAcceptIndices to ExternalPopupMenuClient for Android
https://bugs.webkit.org/show_bug.cgi?id=67574
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (94603 => 94604)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2011-09-06 22:19:28 UTC (rev 94603)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2011-09-06 22:19:47 UTC (rev 94604)
@@ -167,6 +167,7 @@
'public/WebFileWriterClient.h',
'public/WebFindOptions.h',
'public/WebFloatPoint.h',
+ 'public/WebFloatQuad.h',
'public/WebFloatRect.h',
'public/WebFont.h',
'public/WebFontDescription.h',
@@ -470,6 +471,7 @@
'src/WebFileChooserCompletionImpl.h',
'src/WebFileSystemCallbacksImpl.cpp',
'src/WebFileSystemCallbacksImpl.h',
+ 'src/WebFloatQuad.cpp',
'src/WebFontCache.cpp',
'src/WebFontDescription.cpp',
'src/WebFontImpl.cpp',
Modified: trunk/Source/WebKit/chromium/public/WebFloatPoint.h (94603 => 94604)
--- trunk/Source/WebKit/chromium/public/WebFloatPoint.h 2011-09-06 22:19:28 UTC (rev 94603)
+++ trunk/Source/WebKit/chromium/public/WebFloatPoint.h 2011-09-06 22:19:47 UTC (rev 94604)
@@ -34,7 +34,7 @@
#include "WebCommon.h"
#if WEBKIT_IMPLEMENTATION
-#include "IntPoint.h"
+#include "FloatPoint.h"
#endif
namespace WebKit {
Copied: trunk/Source/WebKit/chromium/public/WebFloatQuad.h (from rev 94601, trunk/Source/WebKit/chromium/public/WebFloatPoint.h) (0 => 94604)
--- trunk/Source/WebKit/chromium/public/WebFloatQuad.h (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebFloatQuad.h 2011-09-06 22:19:47 UTC (rev 94604)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFloatQuad_h
+#define WebFloatQuad_h
+
+#include "WebCommon.h"
+#include "WebFloatPoint.h"
+#include "WebRect.h"
+#include <algorithm>
+#include <cmath>
+
+#if WEBKIT_IMPLEMENTATION
+#include "FloatQuad.h"
+#endif
+
+namespace WebKit {
+
+struct WebFloatQuad {
+ WebFloatPoint p[4];
+
+ WebFloatQuad()
+ {
+ }
+
+ WebFloatQuad(const WebFloatPoint& p0, const WebFloatPoint& p1, const WebFloatPoint& p2, const WebFloatPoint& p3)
+ {
+ p[0] = p0;
+ p[1] = p1;
+ p[2] = p2;
+ p[3] = p3;
+ }
+
+ WEBKIT_EXPORT WebRect enclosingRect() const;
+
+#if WEBKIT_IMPLEMENTATION
+ WebFloatQuad& operator=(const WebCore::FloatQuad& q)
+ {
+ p[0] = q.p1();
+ p[1] = q.p2();
+ p[2] = q.p3();
+ p[3] = q.p4();
+ return *this;
+ }
+ WebFloatQuad(const WebCore::FloatQuad& q)
+ {
+ *this = q;
+ }
+#endif
+};
+
+} // namespace WebKit
+
+#endif
Copied: trunk/Source/WebKit/chromium/src/WebFloatQuad.cpp (from rev 94601, trunk/Source/WebKit/chromium/public/WebFloatPoint.h) (0 => 94604)
--- trunk/Source/WebKit/chromium/src/WebFloatQuad.cpp (rev 0)
+++ trunk/Source/WebKit/chromium/src/WebFloatQuad.cpp 2011-09-06 22:19:47 UTC (rev 94604)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebFloatQuad.h"
+
+namespace WebKit {
+
+WebRect WebFloatQuad::enclosingRect() const
+{
+ int left = static_cast<int>(floorf(std::min(std::min(std::min(p[0].x, p[1].x), p[2].x), p[3].x)));
+ int top = static_cast<int>(floorf(std::min(std::min(std::min(p[0].y, p[1].y), p[2].y), p[3].y)));
+ int right = static_cast<int>(ceilf(std::max(std::max(std::max(p[0].x, p[1].x), p[2].x), p[3].x)));
+ int bottom = static_cast<int>(ceilf(std::max(std::max(std::max(p[0].y, p[1].y), p[2].y), p[3].y)));
+
+ return WebRect(left, top, right - left, bottom - top);
+}
+
+} // namespace WebKit