Commit 42c25796 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Check for bitmap equality

Use Skia util function to check for bitmap equality.

Bug: 1102513
Change-Id: I24b713a90e5f6436d387bbbaec9c1cea749ae051
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2293323Reviewed-by: default avatarDarwin Huang <huangdarwin@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#787873}
parent 96a0eba1
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/notreached.h" #include "base/notreached.h"
#include "skia/ext/skia_utils_base.h" #include "skia/ext/skia_utils_base.h"
#include "ui/gfx/skia_util.h"
namespace ui { namespace ui {
...@@ -18,8 +19,6 @@ ClipboardData::ClipboardData(const ClipboardData&) = default; ...@@ -18,8 +19,6 @@ ClipboardData::ClipboardData(const ClipboardData&) = default;
ClipboardData::~ClipboardData() = default; ClipboardData::~ClipboardData() = default;
bool ClipboardData::operator==(const ClipboardData& that) const { bool ClipboardData::operator==(const ClipboardData& that) const {
// TODO(https://crbug.com/1102513): This does not check for equality of
// bitmaps. Hash them for comparison.
return format_ == that.format() && text_ == that.text() && return format_ == that.format() && text_ == that.text() &&
markup_data_ == that.markup_data() && url_ == that.url() && markup_data_ == that.markup_data() && url_ == that.url() &&
rtf_data_ == that.rtf_data() && rtf_data_ == that.rtf_data() &&
...@@ -27,7 +26,8 @@ bool ClipboardData::operator==(const ClipboardData& that) const { ...@@ -27,7 +26,8 @@ bool ClipboardData::operator==(const ClipboardData& that) const {
bookmark_url_ == that.bookmark_url() && bookmark_url_ == that.bookmark_url() &&
custom_data_format_ == that.custom_data_format() && custom_data_format_ == that.custom_data_format() &&
custom_data_data_ == that.custom_data_data() && custom_data_data_ == that.custom_data_data() &&
web_smart_paste_ == that.web_smart_paste(); web_smart_paste_ == that.web_smart_paste() &&
gfx::BitmapsAreEqual(bitmap_, that.bitmap());
} }
void ClipboardData::SetBitmapData(const SkBitmap& bitmap) { void ClipboardData::SetBitmapData(const SkBitmap& bitmap) {
......
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