Commit 2e70d40e authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Remove WebFloatRect

Last usage of WebFloatRect has been removed on the blink public API.

BUG=738465

Change-Id: I83917a10a80dda63c735918969f37103f7877816
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490255Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819740}
parent 853119f4
...@@ -19,18 +19,17 @@ ...@@ -19,18 +19,17 @@
#include "ppapi/thunk/thunk.h" #include "ppapi/thunk/thunk.h"
#include "skia/ext/platform_canvas.h" #include "skia/ext/platform_canvas.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h" #include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/platform/web_float_rect.h"
#include "third_party/blink/public/platform/web_font.h" #include "third_party/blink/public/platform/web_font.h"
#include "third_party/blink/public/platform/web_font_description.h" #include "third_party/blink/public/platform/web_font_description.h"
#include "third_party/blink/public/platform/web_rect.h" #include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_text_run.h" #include "third_party/blink/public/platform/web_text_run.h"
#include "third_party/icu/source/common/unicode/ubidi.h" #include "third_party/icu/source/common/unicode/ubidi.h"
#include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkRect.h"
#include "ui/gfx/geometry/rect_f.h"
using ppapi::StringVar; using ppapi::StringVar;
using ppapi::thunk::EnterResourceNoLock; using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_ImageData_API; using ppapi::thunk::PPB_ImageData_API;
using blink::WebFloatRect;
using blink::WebFont; using blink::WebFont;
using blink::WebFontDescription; using blink::WebFontDescription;
using blink::WebRect; using blink::WebRect;
...@@ -398,10 +397,10 @@ int32_t BrowserFontResource_Trusted::PixelOffsetForCharacter( ...@@ -398,10 +397,10 @@ int32_t BrowserFontResource_Trusted::PixelOffsetForCharacter(
// 0 characters starting at the character in question, it would give us // 0 characters starting at the character in question, it would give us
// a 0-width rect around the insertion point. But that will be on the // a 0-width rect around the insertion point. But that will be on the
// right side of the character for an RTL run, which would be wrong. // right side of the character for an RTL run, which would be wrong.
WebFloatRect rect = font_->SelectionRectForText( gfx::RectF rect = font_->SelectionRectForText(
run, gfx::PointF(), font_->Height(), char_offset - run_begin, run, gfx::PointF(), font_->Height(), char_offset - run_begin,
char_offset - run_begin + 1); char_offset - run_begin + 1);
return cur_pixel_offset + static_cast<int>(rect.x); return cur_pixel_offset + static_cast<int>(rect.x());
} else { } else {
// Character is past this run, account for the pixels and continue // Character is past this run, account for the pixels and continue
// looking. // looking.
......
...@@ -24,7 +24,6 @@ include_rules = [ ...@@ -24,7 +24,6 @@ include_rules = [
"+third_party/blink/public/platform/viewport_intersection_state.h", "+third_party/blink/public/platform/viewport_intersection_state.h",
"+third_party/blink/public/platform/web_content_security_policy.h", "+third_party/blink/public/platform/web_content_security_policy.h",
"+third_party/blink/public/common/page/drag_operation.h", "+third_party/blink/public/common/page/drag_operation.h",
"+third_party/blink/public/platform/web_float_rect.h",
"+third_party/blink/public/platform/web_fullscreen_video_status.h", "+third_party/blink/public/platform/web_fullscreen_video_status.h",
"+third_party/blink/public/platform/web_http_body.h", "+third_party/blink/public/platform/web_http_body.h",
"+third_party/blink/public/platform/web_history_scroll_restoration_type.h", "+third_party/blink/public/platform/web_history_scroll_restoration_type.h",
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_macros.h"
#include "third_party/blink/public/common/widget/visual_properties.h" #include "third_party/blink/public/common/widget/visual_properties.h"
#include "third_party/blink/public/mojom/page/record_content_to_visible_time_request.mojom-forward.h" #include "third_party/blink/public/mojom/page/record_content_to_visible_time_request.mojom-forward.h"
#include "third_party/blink/public/platform/web_float_rect.h"
#include "ui/base/ime/text_input_action.h" #include "ui/base/ime/text_input_action.h"
#include "ui/base/ime/text_input_mode.h" #include "ui/base/ime/text_input_mode.h"
#include "ui/base/ui_base_types.h" #include "ui/base/ui_base_types.h"
......
...@@ -197,7 +197,6 @@ source_set("blink_headers") { ...@@ -197,7 +197,6 @@ source_set("blink_headers") {
"platform/web_encrypted_media_types.h", "platform/web_encrypted_media_types.h",
"platform/web_fetch_client_settings_object.h", "platform/web_fetch_client_settings_object.h",
"platform/web_file_system_type.h", "platform/web_file_system_type.h",
"platform/web_float_rect.h",
"platform/web_font.h", "platform/web_font.h",
"platform/web_font_description.h", "platform/web_font_description.h",
"platform/web_font_render_style.h", "platform/web_font_render_style.h",
......
/*
* Copyright (C) 2010 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 THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_FLOAT_RECT_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_FLOAT_RECT_H_
#include "third_party/blink/public/platform/web_common.h"
#if INSIDE_BLINK
#include "third_party/blink/renderer/platform/geometry/float_rect.h" // nogncheck
#else
#include <algorithm>
#include <cmath>
#include <ui/gfx/geometry/rect_f.h>
#endif
namespace blink {
struct WebFloatRect {
float x;
float y;
float width;
float height;
bool IsEmpty() const { return width <= 0 || height <= 0; }
WebFloatRect() : x(0), y(0), width(0), height(0) {}
WebFloatRect(float x, float y, float width, float height)
: x(x), y(y), width(width), height(height) {}
#if INSIDE_BLINK
WebFloatRect(const FloatRect& r)
: x(r.X()), y(r.Y()), width(r.Width()), height(r.Height()) {}
WebFloatRect& operator=(const FloatRect& r) {
x = r.X();
y = r.Y();
width = r.Width();
height = r.Height();
return *this;
}
operator FloatRect() const { return FloatRect(x, y, width, height); }
#else
WebFloatRect(const gfx::RectF& r)
: x(r.x()), y(r.y()), width(r.width()), height(r.height()) {}
WebFloatRect& operator=(const gfx::RectF& r) {
x = r.x();
y = r.y();
width = r.width();
height = r.height();
return *this;
}
operator gfx::RectF() const {
return gfx::RectF(x, y, std::max(0.0f, width), std::max(0.0f, height));
}
#endif
};
inline bool operator==(const WebFloatRect& a, const WebFloatRect& b) {
return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;
}
inline bool operator!=(const WebFloatRect& a, const WebFloatRect& b) {
return !(a == b);
}
} // namespace blink
#endif
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