Commit be3d7eaa authored by Andrew Xu's avatar Andrew Xu Committed by Chromium LUCI CQ

[Multipaste] Fix the icon for copying multiple files

Now when copying multiple files, the shown icon is based on the
extension of the last copied file, which is unexpected. This CL
does the following things:
(1) Implement the API to get the count of copied files for the given
clipboard data
(2) Show the correct icon according to the count of copied files.

Bug: 1165309
Change-Id: I63222e7037fcc38683ba3c6a0be3dd080f424dcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628735Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarDavid Black <dmblack@google.com>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843747}
parent 0b64e812
......@@ -95,17 +95,14 @@ base::string16 GetLocalizedString(int resource_id) {
base::string16 GetLabelForCustomData(const ui::ClipboardData& data) {
// Currently the only supported type of custom data is file system data. This
// code should not be reached if `data` does not contain file system data.
base::string16 sources = ClipboardHistoryUtil::GetFileSystemSources(data);
base::string16 sources;
std::vector<base::StringPiece16> source_list;
ClipboardHistoryUtil::GetSplitFileSystemData(data, &source_list, &sources);
if (sources.empty()) {
NOTREACHED();
return base::string16();
}
// Split sources into a list.
std::vector<base::StringPiece16> source_list =
base::SplitStringPiece(sources, base::UTF8ToUTF16("\n"),
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
// Strip path information, so all that's left are file names.
for (auto it = source_list.begin(); it != source_list.end(); ++it)
*it = it->substr(it->find_last_of(base::UTF8ToUTF16("/")) + 1);
......
......@@ -10,6 +10,7 @@
#include "ash/metrics/histogram_macros.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shell.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "chromeos/constants/chromeos_features.h"
#include "ui/base/clipboard/clipboard_data.h"
......@@ -86,6 +87,39 @@ bool ContainsFileSystemData(const ui::ClipboardData& data) {
return !GetFileSystemSources(data).empty();
}
void GetSplitFileSystemData(const ui::ClipboardData& data,
std::vector<base::StringPiece16>* source_list,
base::string16* sources) {
DCHECK(sources);
DCHECK(sources->empty());
DCHECK(source_list);
DCHECK(source_list->empty());
*sources = GetFileSystemSources(data);
if (sources->empty()) {
// Not a file system data.
return;
}
// Split sources into a list.
*source_list =
base::SplitStringPiece(*sources, base::UTF8ToUTF16("\n"),
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
}
size_t GetCountOfCopiedFiles(const ui::ClipboardData& data) {
base::string16 sources;
std::vector<base::StringPiece16> source_list;
GetSplitFileSystemData(data, &source_list, &sources);
if (sources.empty()) {
// Not a file system data.
return 0;
}
return source_list.size();
}
base::string16 GetFileSystemSources(const ui::ClipboardData& data) {
if (!ContainsFormat(data, ui::ClipboardInternalFormat::kCustom))
return base::string16();
......
......@@ -8,6 +8,7 @@
#include "ash/ash_export.h"
#include "base/optional.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece_forward.h"
namespace ui {
class ClipboardData;
......@@ -94,6 +95,18 @@ ASH_EXPORT void RecordClipboardHistoryItemPasted(
// Returns true if `data` contains file system data.
ASH_EXPORT bool ContainsFileSystemData(const ui::ClipboardData& data);
// Updates `sources` with the file system sources contained in `data`; updates
// `source_list` by splitting `sources` into pieces each of which corresponds to
// a file. Note that multiple files can be copied simultaneously. `sources` is
// referenced by `source_list` to reduce memory copies.
ASH_EXPORT void GetSplitFileSystemData(
const ui::ClipboardData& data,
std::vector<base::StringPiece16>* source_list,
base::string16* sources);
// Returns the count of copied files contained by the clipboard data.
ASH_EXPORT size_t GetCountOfCopiedFiles(const ui::ClipboardData& data);
// Returns file system sources contained in `data`. If `data` does not contain
// file system sources, an empty string is returned.
ASH_EXPORT base::string16 GetFileSystemSources(const ui::ClipboardData& data);
......
......@@ -103,6 +103,24 @@ TEST_F(ClipboardHistoryUtilTest, GetFileSystemSources) {
base::UTF8ToUTF16("/path/to/My%20File.txt"));
}
TEST_F(ClipboardHistoryUtilTest, GetSplitFileSystemData) {
const std::string file_name1("File1.txt"), file_name2("File2.txt");
ClipboardHistoryItemBuilder builder;
builder.SetFileSystemData({file_name1, file_name2});
base::string16 sources;
std::vector<base::StringPiece16> source_list;
GetSplitFileSystemData(builder.Build().data(), &source_list, &sources);
EXPECT_EQ(file_name1, base::UTF16ToUTF8(source_list[0]));
EXPECT_EQ(file_name2, base::UTF16ToUTF8(source_list[1]));
}
TEST_F(ClipboardHistoryUtilTest, GetFilesCount) {
ClipboardHistoryItemBuilder builder;
builder.SetFileSystemData(
{"/path/to/My%20File1.txt", "/path/to/My%20File2.txt"});
EXPECT_EQ(2u, GetCountOfCopiedFiles(builder.Build().data()));
}
TEST_F(ClipboardHistoryUtilTest, IsSupported) {
ClipboardHistoryItemBuilder builder;
......
......@@ -4,9 +4,15 @@
#include "ash/clipboard/views/clipboard_history_file_item_view.h"
#include <array>
#include "ash/clipboard/clipboard_history_item.h"
#include "ash/public/cpp/file_icon_util.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/scoped_light_mode_as_default.h"
#include "base/files/file_path.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/view_class_properties.h"
......@@ -32,18 +38,13 @@ ClipboardHistoryFileItemView::~ClipboardHistoryFileItemView() = default;
std::unique_ptr<ClipboardHistoryFileItemView::ContentsView>
ClipboardHistoryFileItemView::CreateContentsView() {
auto file_icon = std::make_unique<views::ImageView>();
const std::string copied_file_name = base::UTF16ToUTF8(text());
file_icon->SetImage(GetIconForPath(
base::FilePath(copied_file_name),
ash::AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorPrimary)));
file_icon->SetImageSize(kIconSize);
file_icon->SetProperty(views::kMarginsKey, kIconMargin);
auto contents_view = ClipboardHistoryTextItemView::CreateContentsView();
// `file_icon` should be `contents_view`'s first child.
contents_view->AddChildViewAt(std::move(file_icon), /*index=*/0);
file_icon_ = contents_view->AddChildViewAt(
std::make_unique<views::ImageView>(), /*index=*/0);
file_icon_->SetImageSize(kIconSize);
file_icon_->SetProperty(views::kMarginsKey, kIconMargin);
return contents_view;
}
......@@ -52,4 +53,34 @@ const char* ClipboardHistoryFileItemView::GetClassName() const {
return "ClipboardHistoryFileItemView";
}
void ClipboardHistoryFileItemView::OnThemeChanged() {
ClipboardHistoryTextItemView::OnThemeChanged();
// Use the light mode as default because the light mode is the default mode
// of the native theme which decides the context menu's background color.
// TODO(andrewxu): remove this line after https://crbug.com/1143009 is fixed.
ScopedLightModeAsDefault scoped_light_mode_as_default;
const SkColor icon_color = ash::AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorPrimary);
const int copied_files_count = ClipboardHistoryUtil::GetCountOfCopiedFiles(
clipboard_history_item()->data());
if (copied_files_count == 1) {
// Choose the icon based on the file type that is deduced by the file
// name.
const std::string copied_file_name = base::UTF16ToUTF8(text());
file_icon_->SetImage(
GetIconForPath(base::FilePath(copied_file_name), icon_color));
return;
}
constexpr std::array<const gfx::VectorIcon*, 9> icons = {
&kTwoFilesIcon, &kThreeFilesIcon, &kFourFilesIcon,
&kFiveFilesIcon, &kSixFilesIcon, &kSevenFilesIcon,
&kEightFilesIcon, &kNineFilesIcon, &kMoreThanNineFilesIcon};
file_icon_->SetImage(CreateVectorIcon(
*icons[std::min(copied_files_count, 10) - 2], icon_color));
}
} // namespace ash
......@@ -8,6 +8,7 @@
#include "ash/clipboard/views/clipboard_history_text_item_view.h"
namespace views {
class ImageView;
class MenuItemView;
}
......@@ -29,6 +30,9 @@ class ClipboardHistoryFileItemView : public ClipboardHistoryTextItemView {
// ClipboardHistoryTextItemView:
std::unique_ptr<ContentsView> CreateContentsView() override;
const char* GetClassName() const override;
void OnThemeChanged() override;
views::ImageView* file_icon_ = nullptr;
};
} // namespace ash
......
......@@ -54,8 +54,11 @@ aggregate_vector_icons("ash_vector_icons") {
"dictation_on.icon",
"dictation_on_newui.icon",
"dogfood.icon",
"eight_files.icon",
"files_app.icon",
"five_files.icon",
"folder.icon",
"four_files.icon",
"global_media_controls.icon",
"holding_space.icon",
"hollow_check_circle.icon",
......@@ -82,6 +85,7 @@ aggregate_vector_icons("ash_vector_icons") {
"login_screen_button_dropdown.icon",
"login_screen_menu_dropdown.icon",
"mic.icon",
"more_than_nine_files.icon",
"music_note.icon",
"muted_microphone.icon",
"network_badge_off.icon",
......@@ -101,6 +105,7 @@ aggregate_vector_icons("ash_vector_icons") {
"network_ethernet.icon",
"network_mobile_not_connected_x.icon",
"network_vpn.icon",
"nine_files.icon",
"notification_accessibility.icon",
"notification_accessibility_braille.icon",
"notification_battery_critical.icon",
......@@ -173,6 +178,7 @@ aggregate_vector_icons("ash_vector_icons") {
"select_to_speak_stop.icon",
"send.icon",
"settings.icon",
"seven_files.icon",
"shelf_add_person_button.icon",
"shelf_apps_button.icon",
"shelf_back.icon",
......@@ -190,6 +196,7 @@ aggregate_vector_icons("ash_vector_icons") {
"shelf_shutdown_button.icon",
"shelf_sign_out_button.icon",
"shelf_unlock_button.icon",
"six_files.icon",
"switch_access.icon",
"switch_access_back.icon",
"switch_access_close.icon",
......@@ -299,9 +306,11 @@ aggregate_vector_icons("ash_vector_icons") {
"system_tray_tracing.icon",
"system_tray_update.icon",
"system_tray_volume_mute.icon",
"three_files.icon",
"touch_calibration_complete_check.icon",
"touch_calibration_hand.icon",
"tray_action_new_lock_screen_note.icon",
"two_files.icon",
"unified_menu_accessibility.icon",
"unified_menu_arrow_back.icon",
"unified_menu_battery_alert.icon",
......
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 13.73f, 6.79f,
R_CUBIC_TO, 0, 0.35f, -0.09f, 0.65f, -0.26f, 0.91f,
R_CUBIC_TO, -0.17f, 0.26f, -0.4f, 0.48f, -0.7f, 0.64f,
R_CUBIC_TO, 0.34f, 0.17f, 0.61f, 0.39f, 0.81f, 0.68f,
R_CUBIC_TO, 0.2f, 0.29f, 0.3f, 0.63f, 0.3f, 1.02f,
R_CUBIC_TO, 0, 0.64f, -0.22f, 1.14f, -0.66f, 1.5f,
R_CUBIC_TO, -0.43f, 0.37f, -1.04f, 0.55f, -1.81f, 0.55f,
R_CUBIC_TO, -0.77f, 0, -1.38f, -0.18f, -1.83f, -0.55f,
R_CUBIC_TO, -0.45f, -0.37f, -0.67f, -0.87f, -0.67f, -1.5f,
R_CUBIC_TO, 0, -0.38f, 0.1f, -0.72f, 0.29f, -1.01f,
R_CUBIC_TO, 0.2f, -0.29f, 0.47f, -0.52f, 0.83f, -0.69f,
R_ARC_TO, 1.88f, 1.88f, 0, 0, 1, -0.71f, -0.63f,
R_ARC_TO, 1.63f, 1.63f, 0, 0, 1, -0.26f, -0.91f,
R_CUBIC_TO, 0, -0.62f, 0.21f, -1.11f, 0.63f, -1.46f,
R_CUBIC_TO, 0.42f, -0.36f, 0.99f, -0.54f, 1.7f, -0.54f,
R_CUBIC_TO, 0.72f, 0, 1.29f, 0.18f, 1.71f, 0.54f,
R_CUBIC_TO, 0.42f, 0.36f, 0.63f, 0.85f, 0.63f, 1.47f,
CLOSE,
R_MOVE_TO, -1.51f, 3.12f,
R_CUBIC_TO, 0, -0.29f, -0.08f, -0.52f, -0.23f, -0.67f,
R_ARC_TO, 0.78f, 0.78f, 0, 0, 0, -0.59f, -0.24f,
R_ARC_TO, 0.79f, 0.79f, 0, 0, 0, -0.6f, 0.24f,
R_CUBIC_TO, -0.15f, 0.16f, -0.23f, 0.38f, -0.23f, 0.67f,
R_CUBIC_TO, 0, 0.28f, 0.08f, 0.51f, 0.23f, 0.67f,
R_CUBIC_TO, 0.16f, 0.16f, 0.36f, 0.24f, 0.61f, 0.24f,
R_ARC_TO, 0.77f, 0.77f, 0, 0, 0, 0.59f, -0.24f,
R_CUBIC_TO, 0.15f, -0.16f, 0.23f, -0.39f, 0.23f, -0.67f,
CLOSE,
R_MOVE_TO, -0.83f, -3.85f,
R_CUBIC_TO, -0.22f, 0, -0.39f, 0.07f, -0.51f, 0.22f,
R_CUBIC_TO, -0.11f, 0.14f, -0.17f, 0.34f, -0.17f, 0.6f,
R_CUBIC_TO, 0, 0.25f, 0.06f, 0.46f, 0.18f, 0.62f,
R_CUBIC_TO, 0.12f, 0.16f, 0.29f, 0.24f, 0.52f, 0.24f,
R_CUBIC_TO, 0.23f, 0, 0.39f, -0.08f, 0.5f, -0.23f,
R_CUBIC_TO, 0.11f, -0.16f, 0.17f, -0.36f, 0.17f, -0.61f,
R_CUBIC_TO, 0, -0.25f, -0.06f, -0.45f, -0.18f, -0.6f,
R_CUBIC_TO, -0.11f, -0.15f, -0.28f, -0.22f, -0.51f, -0.22f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
CUBIC_TO, 5, 2.9f, 5.9f, 2, 7, 2,
H_LINE_TO, 16,
CUBIC_TO, 17.1f, 2, 18, 2.9f, 18, 4,
V_LINE_TO, 13,
CUBIC_TO, 18, 14.1f, 17.1f, 15, 16, 15,
H_LINE_TO, 7,
CUBIC_TO, 5.9f, 15, 5, 14.1f, 5, 13,
V_LINE_TO, 4,
CLOSE,
MOVE_TO, 6.5f, 3.5f,
H_LINE_TO, 16.5f,
V_LINE_TO, 13.5f,
H_LINE_TO, 6.5f,
V_LINE_TO, 3.5f,
CLOSE,
MOVE_TO, 4, 18,
CUBIC_TO, 2.9f, 18, 2, 17.1f, 2, 16,
V_LINE_TO, 5,
H_LINE_TO, 3.5f,
V_LINE_TO, 16.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 9.03f, 8.52f,
LINE_TO, 9.47f, 4.89f,
H_LINE_TO, 13.62f,
V_LINE_TO, 6.17f,
H_LINE_TO, 10.8f,
LINE_TO, 10.64f, 7.58f,
CUBIC_TO, 10.76f, 7.51f, 10.91f, 7.45f, 11.1f, 7.4f,
CUBIC_TO, 11.29f, 7.35f, 11.48f, 7.32f, 11.66f, 7.32f,
CUBIC_TO, 12.37f, 7.32f, 12.91f, 7.53f, 13.29f, 7.95f,
CUBIC_TO, 13.67f, 8.37f, 13.86f, 8.95f, 13.86f, 9.71f,
CUBIC_TO, 13.86f, 10.17f, 13.76f, 10.58f, 13.55f, 10.95f,
CUBIC_TO, 13.35f, 11.32f, 13.07f, 11.6f, 12.7f, 11.8f,
CUBIC_TO, 12.33f, 12, 11.9f, 12.1f, 11.4f, 12.1f,
CUBIC_TO, 10.95f, 12.1f, 10.53f, 12.01f, 10.14f, 11.82f,
CUBIC_TO, 9.75f, 11.64f, 9.44f, 11.39f, 9.22f, 11.07f,
CUBIC_TO, 9, 10.75f, 8.89f, 10.38f, 8.9f, 9.98f,
H_LINE_TO, 10.55f,
CUBIC_TO, 10.56f, 10.24f, 10.65f, 10.45f, 10.79f, 10.6f,
CUBIC_TO, 10.94f, 10.75f, 11.14f, 10.83f, 11.39f, 10.83f,
CUBIC_TO, 11.94f, 10.83f, 12.22f, 10.42f, 12.22f, 9.6f,
CUBIC_TO, 12.22f, 8.84f, 11.88f, 8.46f, 11.2f, 8.46f,
CUBIC_TO, 10.82f, 8.46f, 10.53f, 8.58f, 10.34f, 8.83f,
LINE_TO, 9.03f, 8.52f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 13.28f, 9.22f,
R_H_LINE_TO, 0.72f,
R_V_LINE_TO, 1.27f,
R_H_LINE_TO, -0.72f,
V_LINE_TO, 12,
R_H_LINE_TO, -1.64f,
R_V_LINE_TO, -1.51f,
R_H_LINE_TO, -2.75f,
R_LINE_TO, -0.1f, -1.01f,
R_LINE_TO, 2.85f, -4.58f,
R_V_LINE_TO, -0.01f,
R_H_LINE_TO, 1.65f,
R_V_LINE_TO, 4.33f,
CLOSE,
R_MOVE_TO, -2.92f, 0,
R_H_LINE_TO, 1.28f,
V_LINE_TO, 7.03f,
R_LINE_TO, -0.1f, 0.17f,
R_LINE_TO, -1.18f, 2.02f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 9.99f, 9.53f,
R_CUBIC_TO, -0.32f, 0.29f, -0.68f, 0.43f, -1.08f, 0.43f,
R_CUBIC_TO, -0.58f, 0, -1.05f, -0.2f, -1.39f, -0.59f,
CUBIC_TO, 7.17f, 8.98f, 7, 8.45f, 7, 7.79f,
R_CUBIC_TO, 0, -0.41f, 0.1f, -0.79f, 0.29f, -1.14f,
R_CUBIC_TO, 0.19f, -0.35f, 0.46f, -0.63f, 0.81f, -0.83f,
R_ARC_TO, 2.23f, 2.23f, 0, 0, 1, 1.15f, -0.31f,
R_CUBIC_TO, 0.43f, 0, 0.81f, 0.11f, 1.15f, 0.32f,
R_CUBIC_TO, 0.35f, 0.21f, 0.61f, 0.51f, 0.81f, 0.9f,
R_CUBIC_TO, 0.19f, 0.39f, 0.29f, 0.83f, 0.3f, 1.34f,
R_V_LINE_TO, 0.57f,
R_CUBIC_TO, 0, 0.71f, -0.14f, 1.32f, -0.42f, 1.84f,
R_ARC_TO, 2.86f, 2.86f, 0, 0, 1, -1.19f, 1.2f,
R_CUBIC_TO, -0.52f, 0.28f, -1.12f, 0.42f, -1.81f, 0.42f,
R_H_LINE_TO, -0.09f,
V_LINE_TO, 10.9f,
R_LINE_TO, 0.28f, 0,
R_CUBIC_TO, 1.03f, -0.05f, 1.6f, -0.51f, 1.71f, -1.37f,
CLOSE,
R_MOVE_TO, -0.68f, -0.64f,
R_CUBIC_TO, 0.32f, 0, 0.56f, -0.14f, 0.7f, -0.42f,
R_V_LINE_TO, -0.61f,
R_CUBIC_TO, 0, -0.41f, -0.07f, -0.71f, -0.21f, -0.91f,
R_ARC_TO, 0.65f, 0.65f, 0, 0, 0, -0.56f, -0.29f,
R_CUBIC_TO, -0.21f, 0, -0.39f, 0.11f, -0.53f, 0.33f,
R_ARC_TO, 1.48f, 1.48f, 0, 0, 0, -0.21f, 0.81f,
R_CUBIC_TO, 0, 0.33f, 0.07f, 0.6f, 0.22f, 0.8f,
R_ARC_TO, 0.7f, 0.7f, 0, 0, 0, 0.59f, 0.3f,
CLOSE,
MOVE_TO, 12, 8,
R_H_LINE_TO, 4.5f,
R_V_LINE_TO, 1.5f,
H_LINE_TO, 12,
V_LINE_TO, 8,
CLOSE,
MOVE_TO, 13.5f, 11,
V_LINE_TO, 6.5f,
H_LINE_TO, 15,
V_LINE_TO, 11,
R_H_LINE_TO, -1.5f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 12.18f, 9.25f,
R_CUBIC_TO, -0.35f, 0.32f, -0.75f, 0.48f, -1.19f, 0.48f,
R_CUBIC_TO, -0.64f, 0, -1.15f, -0.22f, -1.53f, -0.65f,
R_CUBIC_TO, -0.38f, -0.44f, -0.57f, -1.02f, -0.57f, -1.75f,
R_CUBIC_TO, 0, -0.46f, 0.11f, -0.88f, 0.32f, -1.27f,
R_CUBIC_TO, 0.21f, -0.39f, 0.51f, -0.7f, 0.89f, -0.93f,
R_ARC_TO, 2.44f, 2.44f, 0, 0, 1, 1.27f, -0.34f,
R_ARC_TO, 2.36f, 2.36f, 0, 0, 1, 2.16f, 1.36f,
R_CUBIC_TO, 0.21f, 0.43f, 0.32f, 0.93f, 0.33f, 1.49f,
R_V_LINE_TO, 0.63f,
R_CUBIC_TO, 0, 0.78f, -0.15f, 1.46f, -0.46f, 2.04f,
R_ARC_TO, 3.17f, 3.17f, 0, 0, 1, -1.31f, 1.33f,
R_CUBIC_TO, -0.57f, 0.31f, -1.23f, 0.46f, -1.99f, 0.46f,
R_H_LINE_TO, -0.1f,
R_V_LINE_TO, -1.32f,
R_LINE_TO, 0.31f, 0,
R_CUBIC_TO, 1.13f, -0.05f, 1.76f, -0.56f, 1.89f, -1.52f,
CLOSE,
R_MOVE_TO, -0.75f, -0.71f,
R_CUBIC_TO, 0.36f, 0, 0.62f, -0.15f, 0.77f, -0.46f,
R_V_LINE_TO, -0.68f,
R_CUBIC_TO, 0, -0.46f, -0.08f, -0.79f, -0.23f, -1.01f,
R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, -0.62f, -0.33f,
R_CUBIC_TO, -0.23f, 0, -0.42f, 0.12f, -0.58f, 0.37f,
R_CUBIC_TO, -0.16f, 0.25f, -0.23f, 0.55f, -0.23f, 0.9f,
R_CUBIC_TO, 0, 0.37f, 0.08f, 0.67f, 0.24f, 0.89f,
R_CUBIC_TO, 0.16f, 0.22f, 0.38f, 0.33f, 0.65f, 0.33f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 14.38f, 5.77f,
LINE_TO, 11.72f, 12,
H_LINE_TO, 9.98f,
R_LINE_TO, 2.66f, -5.84f,
R_H_LINE_TO, -3.39f,
V_LINE_TO, 4.89f,
R_H_LINE_TO, 5.12f,
R_V_LINE_TO, 0.88f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 12.91f, 4.79f,
R_V_LINE_TO, 1.29f,
R_H_LINE_TO, -0.07f,
R_CUBIC_TO, -0.61f, 0, -1.12f, 0.15f, -1.52f, 0.44f,
R_CUBIC_TO, -0.39f, 0.29f, -0.64f, 0.7f, -0.73f, 1.23f,
R_CUBIC_TO, 0.37f, -0.36f, 0.84f, -0.55f, 1.41f, -0.55f,
R_CUBIC_TO, 0.62f, 0, 1.11f, 0.23f, 1.47f, 0.67f,
R_CUBIC_TO, 0.36f, 0.45f, 0.55f, 1.04f, 0.55f, 1.77f,
R_CUBIC_TO, 0, 0.45f, -0.11f, 0.87f, -0.32f, 1.25f,
R_CUBIC_TO, -0.21f, 0.38f, -0.51f, 0.67f, -0.89f, 0.89f,
R_ARC_TO, 2.57f, 2.57f, 0, 0, 1, -1.27f, 0.32f,
R_ARC_TO, 2.67f, 2.67f, 0, 0, 1, -1.35f, -0.34f,
R_ARC_TO, 2.38f, 2.38f, 0, 0, 1, -0.93f, -0.99f,
R_CUBIC_TO, -0.22f, -0.43f, -0.33f, -0.92f, -0.34f, -1.47f,
R_V_LINE_TO, -0.66f,
R_CUBIC_TO, 0, -0.73f, 0.16f, -1.39f, 0.47f, -1.97f,
R_ARC_TO, 3.43f, 3.43f, 0, 0, 1, 1.35f, -1.38f,
R_ARC_TO, 3.85f, 3.85f, 0, 0, 1, 1.94f, -0.5f,
R_H_LINE_TO, 0.25f,
CLOSE,
R_MOVE_TO, -1.48f, 3.68f,
R_CUBIC_TO, -0.22f, 0, -0.4f, 0.05f, -0.55f, 0.15f,
R_ARC_TO, 0.96f, 0.96f, 0, 0, 0, -0.33f, 0.37f,
R_V_LINE_TO, 0.49f,
R_CUBIC_TO, 0, 0.9f, 0.31f, 1.35f, 0.93f, 1.35f,
R_CUBIC_TO, 0.25f, 0, 0.46f, -0.11f, 0.63f, -0.34f,
R_CUBIC_TO, 0.17f, -0.22f, 0.25f, -0.51f, 0.25f, -0.84f,
R_CUBIC_TO, 0, -0.35f, -0.09f, -0.63f, -0.26f, -0.85f,
R_ARC_TO, 0.81f, 0.81f, 0, 0, 0, -0.68f, -0.33f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 10.94f, 7.76f,
R_H_LINE_TO, 0.78f,
R_CUBIC_TO, 0.62f, 0, 0.92f, -0.3f, 0.92f, -0.9f,
R_ARC_TO, 0.77f, 0.77f, 0, 0, 0, -0.22f, -0.57f,
R_CUBIC_TO, -0.15f, -0.15f, -0.35f, -0.22f, -0.62f, -0.22f,
R_ARC_TO, 0.9f, 0.9f, 0, 0, 0, -0.57f, 0.19f,
R_ARC_TO, 0.58f, 0.58f, 0, 0, 0, -0.24f, 0.47f,
H_LINE_TO, 9.34f,
R_CUBIC_TO, 0, -0.37f, 0.1f, -0.71f, 0.31f, -1,
R_CUBIC_TO, 0.21f, -0.29f, 0.5f, -0.52f, 0.87f, -0.68f,
R_ARC_TO, 2.95f, 2.95f, 0, 0, 1, 1.22f, -0.25f,
R_CUBIC_TO, 0.79f, 0, 1.41f, 0.18f, 1.87f, 0.54f,
R_CUBIC_TO, 0.45f, 0.36f, 0.68f, 0.86f, 0.68f, 1.49f,
R_CUBIC_TO, 0, 0.31f, -0.09f, 0.6f, -0.28f, 0.87f,
R_CUBIC_TO, -0.18f, 0.27f, -0.46f, 0.49f, -0.81f, 0.66f,
R_CUBIC_TO, 0.38f, 0.14f, 0.67f, 0.35f, 0.89f, 0.63f,
R_CUBIC_TO, 0.22f, 0.28f, 0.32f, 0.62f, 0.32f, 1.03f,
R_CUBIC_TO, 0, 0.64f, -0.24f, 1.14f, -0.73f, 1.52f,
R_CUBIC_TO, -0.49f, 0.38f, -1.13f, 0.57f, -1.92f, 0.57f,
R_CUBIC_TO, -0.46f, 0, -0.9f, -0.09f, -1.3f, -0.26f,
R_CUBIC_TO, -0.4f, -0.18f, -0.7f, -0.42f, -0.9f, -0.74f,
R_ARC_TO, 1.93f, 1.93f, 0, 0, 1, -0.31f, -1.07f,
R_H_LINE_TO, 1.66f,
R_CUBIC_TO, 0, 0.22f, 0.09f, 0.41f, 0.26f, 0.57f,
R_CUBIC_TO, 0.18f, 0.16f, 0.39f, 0.24f, 0.65f, 0.24f,
R_CUBIC_TO, 0.29f, 0, 0.52f, -0.08f, 0.69f, -0.24f,
R_ARC_TO, 0.82f, 0.82f, 0, 0, 0, 0.26f, -0.62f,
R_CUBIC_TO, 0, -0.36f, -0.09f, -0.61f, -0.27f, -0.76f,
R_CUBIC_TO, -0.18f, -0.15f, -0.43f, -0.22f, -0.74f, -0.22f,
R_H_LINE_TO, -0.8f,
V_LINE_TO, 7.76f,
CLOSE
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 20,
MOVE_TO, 5, 4,
R_ARC_TO, 2, 2, 0, 0, 1, 2, -2,
R_H_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, 2, 2,
R_V_LINE_TO, 9,
R_ARC_TO, 2, 2, 0, 0, 1, -2, 2,
H_LINE_TO, 7,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 1.5f, -0.5f,
R_H_LINE_TO, 10,
R_V_LINE_TO, 10,
R_H_LINE_TO, -10,
R_V_LINE_TO, -10,
CLOSE,
MOVE_TO, 4, 18,
R_ARC_TO, 2, 2, 0, 0, 1, -2, -2,
V_LINE_TO, 5,
R_H_LINE_TO, 1.5f,
R_V_LINE_TO, 11.5f,
H_LINE_TO, 15,
V_LINE_TO, 18,
H_LINE_TO, 4,
CLOSE,
MOVE_TO, 14.4f, 12,
H_LINE_TO, 9.43f,
R_V_LINE_TO, -1.07f,
R_LINE_TO, 2.29f, -2.4f,
R_CUBIC_TO, 0.56f, -0.64f, 0.85f, -1.15f, 0.85f, -1.53f,
R_CUBIC_TO, 0, -0.31f, -0.07f, -0.54f, -0.2f, -0.7f,
R_CUBIC_TO, -0.13f, -0.16f, -0.33f, -0.24f, -0.58f, -0.24f,
R_ARC_TO, 0.72f, 0.72f, 0, 0, 0, -0.61f, 0.32f,
R_CUBIC_TO, -0.16f, 0.21f, -0.23f, 0.48f, -0.23f, 0.8f,
R_H_LINE_TO, -1.65f,
R_CUBIC_TO, 0, -0.44f, 0.11f, -0.84f, 0.33f, -1.21f,
R_CUBIC_TO, 0.22f, -0.37f, 0.52f, -0.66f, 0.91f, -0.87f,
R_CUBIC_TO, 0.39f, -0.21f, 0.82f, -0.31f, 1.3f, -0.31f,
R_CUBIC_TO, 0.77f, 0, 1.36f, 0.18f, 1.77f, 0.53f,
R_CUBIC_TO, 0.42f, 0.36f, 0.63f, 0.87f, 0.63f, 1.53f,
R_CUBIC_TO, 0, 0.28f, -0.05f, 0.55f, -0.16f, 0.82f,
R_ARC_TO, 3.62f, 3.62f, 0, 0, 1, -0.49f, 0.84f,
R_CUBIC_TO, -0.22f, 0.29f, -0.57f, 0.68f, -1.06f, 1.17f,
R_LINE_TO, -0.92f, 1.06f,
R_H_LINE_TO, 2.8f,
V_LINE_TO, 12,
CLOSE
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