Commit 2d9b6439 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Remove All USE_COLOR_PIPELINE References from //BUILD.gn and //ui Except for Flag Declarations

The flag declarations are still used by dependent directories.

BUG=1057239
TBR=brucedawson@chromium.org
Unit test deps change due to flag removal.

Change-Id: If5404c1855ee1b284c37b773b3fb835e6c8ee8c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080867
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746902}
parent 60eda8cc
......@@ -85,6 +85,7 @@ group("gn_all") {
"//tools/ipc_fuzzer:ipc_fuzzer_all",
"//tools/metrics:metrics_metadata",
"//ui/base:ui_base_unittests",
"//ui/color:color_unittests",
"//ui/gfx:gfx_unittests",
"//url:url_unittests",
]
......@@ -829,10 +830,6 @@ group("gn_all") {
]
}
if (use_color_pipeline) {
deps += [ "//ui/color:color_unittests" ]
}
# PFFFT.
deps += [
"//third_party/pffft:fuzzers",
......
......@@ -17,96 +17,83 @@ source_set("color_headers") {
sources = [
"color_id.h",
"color_id_macros.inc",
"color_mixer.h",
"color_provider.h",
"color_set.h",
]
public_deps = [ ":color_buildflags" ]
if (use_color_pipeline) {
sources += [
"color_mixer.h",
"color_set.h",
]
public_deps += [
"//base:base",
"//skia:skia",
]
} else {
public_deps += [
"//ui/base:base",
"//ui/native_theme:native_theme",
]
}
public_deps = [
":color_buildflags",
"//base:base",
"//skia:skia",
]
}
if (use_color_pipeline) {
jumbo_component("color") {
sources = [
"color_mixer.cc",
"color_provider.cc",
"color_recipe.cc",
"color_recipe.h",
"color_set.cc",
"color_transform.cc",
"color_transform.h",
]
defines = [ "IS_COLOR_IMPL" ]
public_deps = [
":color_headers",
"//base:base",
"//skia:skia",
"//ui/gfx:color_utils",
]
}
jumbo_component("color") {
sources = [
"color_mixer.cc",
"color_provider.cc",
"color_recipe.cc",
"color_recipe.h",
"color_set.cc",
"color_transform.cc",
"color_transform.h",
]
test("color_unittests") {
testonly = true
sources = [
"color_mixer_unittest.cc",
"color_provider_unittest.cc",
"color_recipe_unittest.cc",
"color_test_ids.h",
"color_transform_unittest.cc",
"run_all_unittests.cc",
]
deps = [
":color",
"//base/test:test_support",
"//testing/gtest",
]
}
defines = [ "IS_COLOR_IMPL" ]
public_deps = [
":color_headers",
"//base:base",
"//skia:skia",
"//ui/gfx:color_utils",
]
}
test("color_unittests") {
testonly = true
sources = [
"color_mixer_unittest.cc",
"color_provider_unittest.cc",
"color_recipe_unittest.cc",
"color_test_ids.h",
"color_transform_unittest.cc",
"run_all_unittests.cc",
]
deps = [
":color",
"//base/test:test_support",
"//testing/gtest",
]
}
jumbo_component("mixers") {
sources = [
"color_mixers.h",
"core_default_color_mixer.cc",
"ui_color_mixer.cc",
]
defines = [ "IS_COLOR_IMPL" ]
deps = [
":color",
":color_headers",
"//skia",
"//ui/gfx:color_utils",
]
public_deps = [ "//base" ]
jumbo_component("mixers") {
sources = [
"color_mixers.h",
"core_default_color_mixer.cc",
"ui_color_mixer.cc",
]
defines = [ "IS_COLOR_IMPL" ]
deps = [
":color",
":color_headers",
"//skia",
"//ui/gfx:color_utils",
]
public_deps = [ "//base" ]
if (is_chromeos) {
sources += [ "cros/native_color_mixer.cc" ]
} else if (is_linux) {
sources += [ "linux/native_color_mixer.cc" ]
} else if (is_mac) {
sources += [ "mac/native_color_mixer.cc" ]
} else if (is_win) {
sources += [ "win/native_color_mixer.cc" ]
}
if (is_chromeos) {
sources += [ "cros/native_color_mixer.cc" ]
} else if (is_linux) {
sources += [ "linux/native_color_mixer.cc" ]
} else if (is_mac) {
sources += [ "mac/native_color_mixer.cc" ]
} else if (is_win) {
sources += [ "win/native_color_mixer.cc" ]
}
}
include_rules = [
"+third_party/skia/include",
"+ui/base/theme_provider.h", # used by color_provider.h when !USE_COLOR_PIPELINE.
"+ui/gfx",
"+ui/native_theme/native_theme.h", # used by color_id.h when !USE_COLOR_PIPELINE.
]
......@@ -9,14 +9,6 @@
#include "build/buildflag.h"
#include "ui/color/color_buildflags.h"
#if !BUILDFLAG(USE_COLOR_PIPELINE)
#include "ui/native_theme/native_theme.h" // nogncheck
#if defined(OS_WIN)
#include <windows.h>
#endif
#endif
// clang-format off
#define CROSS_PLATFORM_COLOR_IDS \
/* Core color concepts */ \
......@@ -206,8 +198,6 @@ enum ColorIds : ColorId {
#include "ui/color/color_id_macros.inc"
#if BUILDFLAG(USE_COLOR_PIPELINE)
// ColorSetId contains identifiers for all distinct color sets known to the core
// UI layer. As with ColorId, embedders can extend this enum with additional
// values that are understood by the ColorProvider implementation. Embedders
......@@ -237,8 +227,6 @@ enum ColorSetIds : ColorSetId {
// Verifies that |id| is a color set ID, not a color ID.
#define DCHECK_COLOR_SET_ID_VALID(id) DCHECK_GE(id, kUiColorSetsStart)
#endif // BUILDFLAG(USE_COLOR_PIPELINE)
} // namespace ui
#endif // UI_COLOR_COLOR_ID_H_
......@@ -20,21 +20,11 @@
#define D2(enum_name, enum_value) enum_name = enum_value
#endif // defined(STRINGIZE_COLOR_IDS)
// Select which token in the declaration is the assigned value.
#if BUILDFLAG(USE_COLOR_PIPELINE)
// Use first and optional third token, ignore optional second.
#define E1(enum_name) D1(enum_name)
#define E2(enum_name, old_enum_name) D1(enum_name)
#define E3(enum_name, old_enum_name, enum_value) D2(enum_name, enum_value)
#define E_CPONLY(...) E(__VA_ARGS__)
#else
// Use first and mandatory second token, ignore optional third.
#define E1(enum_name) \
static_assert(false, "New-style color compiled for !USE_COLOR_PIPELINE")
#define E2(enum_name, old_enum_name) D2(enum_name, old_enum_name)
#define E3(enum_name, old_enum_name, enum_value) D2(enum_name, old_enum_name)
// Ignore any new color id defined only for color pipeline enabled.
#define E_CPONLY(...)
#endif // BUILDFLAG(USE_COLOR_PIPELINE)
#define GET_E(_1, _2, _3, macro_name, ...) macro_name
#define E(...) GET_E(__VA_ARGS__, E3, E2, E1)(__VA_ARGS__),
#else
......
......@@ -8,21 +8,14 @@
#include <forward_list>
#include <map>
#include "ui/color/color_buildflags.h"
#if BUILDFLAG(USE_COLOR_PIPELINE)
#include "base/component_export.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/color/color_buildflags.h"
#include "ui/color/color_id.h"
#include "ui/color/color_mixer.h"
#else
#include "ui/base/theme_provider.h" // nogncheck
#endif
namespace ui {
#if BUILDFLAG(USE_COLOR_PIPELINE)
// A ColorProvider holds the complete pipeline of ColorMixers that compute
// result colors for UI elements. ColorProvider is meant to be a long-lived
// object whose internal list of mixers does not change after initial
......@@ -57,12 +50,6 @@ class COMPONENT_EXPORT(COLOR) ColorProvider {
mutable std::map<ColorId, SkColor> cache_;
};
#else
using ColorProvider = ThemeProvider;
#endif // !BUILDFLAG(USE_COLOR_PIPELINE)
} // namespace ui
#endif // UI_COLOR_COLOR_PROVIDER_H_
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