Commit d6dbb37c authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

Remove dependency from platform/fonts to platform/graphics

A couple of font-specific files were moved to fonts, and
some cc types were inlined.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ibb99014e2b35e215d31a04a9d9933ea21d0035ae
Reviewed-on: https://chromium-review.googlesource.com/1185639Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589628}
parent f79adf2a
......@@ -679,6 +679,9 @@ jumbo_component("platform") {
"fonts/opentype/open_type_vertical_data.h",
"fonts/orientation_iterator.cc",
"fonts/orientation_iterator.h",
"fonts/paint_font.h",
"fonts/paint_text_blob.h",
"fonts/paint_typeface.h",
"fonts/script_run_iterator.cc",
"fonts/script_run_iterator.h",
"fonts/segmented_font_data.cc",
......@@ -1029,7 +1032,6 @@ jumbo_component("platform") {
"graphics/paint/paint_controller_debug_data.cc",
"graphics/paint/paint_filter.h",
"graphics/paint/paint_flags.h",
"graphics/paint/paint_font.h",
"graphics/paint/paint_property_node.cc",
"graphics/paint/paint_property_node.h",
"graphics/paint/paint_record.h",
......@@ -1037,8 +1039,6 @@ jumbo_component("platform") {
"graphics/paint/paint_record_builder.h",
"graphics/paint/paint_recorder.h",
"graphics/paint/paint_shader.h",
"graphics/paint/paint_text_blob.h",
"graphics/paint/paint_typeface.h",
"graphics/paint/property_tree_state.cc",
"graphics/paint/property_tree_state.h",
"graphics/paint/raster_invalidation_tracking.cc",
......
......@@ -6,9 +6,9 @@ include_rules = [
"+third_party/blink/renderer/platform/fonts",
# Dependencies.
"+cc",
"+third_party/blink/renderer/platform/font_family_names.h",
"+third_party/blink/renderer/platform/geometry",
"+third_party/blink/renderer/platform/graphics",
"+third_party/blink/renderer/platform/heap",
"+third_party/blink/renderer/platform/histogram.h",
"+third_party/blink/renderer/platform/instrumentation",
......
......@@ -24,19 +24,19 @@
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "cc/paint/paint_canvas.h"
#include "cc/paint/paint_flags.h"
#include "third_party/blink/renderer/platform/fonts/character_range.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/font_fallback_iterator.h"
#include "third_party/blink/renderer/platform/fonts/font_fallback_list.h"
#include "third_party/blink/renderer/platform/fonts/ng_text_fragment_paint_info.h"
#include "third_party/blink/renderer/platform/fonts/paint_text_blob.h"
#include "third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_bloberizer.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/fonts/text_run_paint_info.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_canvas.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_flags.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_text_blob.h"
#include "third_party/blink/renderer/platform/layout_unit.h"
#include "third_party/blink/renderer/platform/text/bidi_resolver.h"
#include "third_party/blink/renderer/platform/text/character.h"
......@@ -107,12 +107,12 @@ void Font::Update(FontSelector* font_selector) const {
namespace {
void DrawBlobs(cc::PaintCanvas* canvas,
const PaintFlags& flags,
const cc::PaintFlags& flags,
const ShapeResultBloberizer::BlobBuffer& blobs,
const FloatPoint& point) {
for (const auto& blob_info : blobs) {
DCHECK(blob_info.blob);
PaintCanvasAutoRestore auto_restore(canvas, false);
cc::PaintCanvasAutoRestore auto_restore(canvas, false);
if (blob_info.rotation == CanvasRotationInVertical::kRotateCanvasUpright) {
canvas->save();
......@@ -131,7 +131,7 @@ void Font::DrawText(cc::PaintCanvas* canvas,
const TextRunPaintInfo& run_info,
const FloatPoint& point,
float device_scale_factor,
const PaintFlags& flags) const {
const cc::PaintFlags& flags) const {
// Don't draw anything while we are using custom fonts that are in the process
// of loading.
if (ShouldSkipDrawing())
......@@ -149,7 +149,7 @@ void Font::DrawText(cc::PaintCanvas* canvas,
const NGTextFragmentPaintInfo& text_info,
const FloatPoint& point,
float device_scale_factor,
const PaintFlags& flags) const {
const cc::PaintFlags& flags) const {
// Don't draw anything while we are using custom fonts that are in the process
// of loading.
if (ShouldSkipDrawing())
......@@ -166,7 +166,7 @@ bool Font::DrawBidiText(cc::PaintCanvas* canvas,
const FloatPoint& point,
CustomFontNotReadyAction custom_font_not_ready_action,
float device_scale_factor,
const PaintFlags& flags) const {
const cc::PaintFlags& flags) const {
// Don't draw anything while we are using custom fonts that are in the process
// of loading, except if the 'force' argument is set to true (in which case it
// will use a fallback font).
......@@ -222,7 +222,7 @@ void Font::DrawEmphasisMarks(cc::PaintCanvas* canvas,
const AtomicString& mark,
const FloatPoint& point,
float device_scale_factor,
const PaintFlags& flags) const {
const cc::PaintFlags& flags) const {
if (ShouldSkipDrawing())
return;
......@@ -245,7 +245,7 @@ void Font::DrawEmphasisMarks(cc::PaintCanvas* canvas,
const AtomicString& mark,
const FloatPoint& point,
float device_scale_factor,
const PaintFlags& flags) const {
const cc::PaintFlags& flags) const {
if (ShouldSkipDrawing())
return;
......@@ -301,7 +301,7 @@ unsigned InterceptsFromBlobs(const ShapeResultBloberizer::BlobBuffer& blobs,
}
void GetTextInterceptsInternal(const ShapeResultBloberizer::BlobBuffer& blobs,
const PaintFlags& flags,
const cc::PaintFlags& flags,
const std::tuple<float, float>& bounds,
Vector<Font::TextIntercept>& intercepts) {
// Get the number of intervals, without copying the actual values by
......@@ -322,7 +322,7 @@ void GetTextInterceptsInternal(const ShapeResultBloberizer::BlobBuffer& blobs,
void Font::GetTextIntercepts(const TextRunPaintInfo& run_info,
float device_scale_factor,
const PaintFlags& flags,
const cc::PaintFlags& flags,
const std::tuple<float, float>& bounds,
Vector<TextIntercept>& intercepts) const {
if (ShouldSkipDrawing())
......@@ -340,7 +340,7 @@ void Font::GetTextIntercepts(const TextRunPaintInfo& run_info,
void Font::GetTextIntercepts(const NGTextFragmentPaintInfo& text_info,
float device_scale_factor,
const PaintFlags& flags,
const cc::PaintFlags& flags,
const std::tuple<float, float>& bounds,
Vector<TextIntercept>& intercepts) const {
if (ShouldSkipDrawing())
......
......@@ -37,9 +37,9 @@
#include "third_party/blink/renderer/platform/fonts/font_platform_data.h"
#include "third_party/blink/renderer/platform/fonts/opentype/font_format_check.h"
#include "third_party/blink/renderer/platform/fonts/opentype/font_settings.h"
#include "third_party/blink/renderer/platform/fonts/paint_typeface.h"
#include "third_party/blink/renderer/platform/fonts/web_font_decoder.h"
#include "third_party/blink/renderer/platform/fonts/web_font_typeface_factory.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_typeface.h"
#include "third_party/blink/renderer/platform/shared_buffer.h"
#include "third_party/skia/include/core/SkStream.h"
#include "third_party/skia/include/core/SkTypeface.h"
......
......@@ -28,7 +28,6 @@
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/layout_test_support.h"
#include "third_party/blink/renderer/platform/text/character.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
......
......@@ -38,9 +38,9 @@
#include "third_party/blink/public/platform/web_font_render_style.h"
#include "third_party/blink/renderer/platform/fonts/font_description.h"
#include "third_party/blink/renderer/platform/fonts/font_orientation.h"
#include "third_party/blink/renderer/platform/fonts/paint_font.h"
#include "third_party/blink/renderer/platform/fonts/paint_typeface.h"
#include "third_party/blink/renderer/platform/fonts/small_caps_iterator.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_font.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_typeface.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
......
......@@ -4,9 +4,9 @@
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "cc/paint/paint_flags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/fonts/text_run_paint_info.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_flags.h"
#include "third_party/blink/renderer/platform/testing/font_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/text/text_run.h"
......@@ -45,7 +45,7 @@ TEST_F(FontTest, TextIntercepts) {
0x70, 0xc9, 0x70, 0xc9};
TextRun ahem_above_below_baseline(ahem_above_below_baseline_string, 9);
TextRunPaintInfo text_run_paint_info(ahem_above_below_baseline);
PaintFlags default_paint;
cc::PaintFlags default_paint;
float device_scale_factor = 1;
std::tuple<float, float> below_baseline_bounds = std::make_tuple(2, 4);
......
......@@ -30,10 +30,10 @@
#import "third_party/blink/renderer/platform/fonts/font.h"
#import "third_party/blink/renderer/platform/fonts/opentype/font_settings.h"
#import "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h"
#import "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#import "third_party/blink/renderer/platform/layout_test_support.h"
#import "third_party/blink/renderer/platform/wtf/retain_ptr.h"
#import "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#import "third_party/skia/include/core/SkStream.h"
#import "third_party/skia/include/ports/SkTypeface_mac.h"
namespace blink {
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_FONT_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_FONT_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_FONT_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_FONT_H_
#include "cc/paint/paint_font.h"
......@@ -11,4 +11,4 @@ namespace blink {
using cc::PaintFont;
}
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_FONT_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_FONT_H_
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_TEXT_BLOB_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_TEXT_BLOB_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_TEXT_BLOB_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_TEXT_BLOB_H_
#include "cc/paint/paint_text_blob.h"
#include "cc/paint/paint_text_blob_builder.h"
......@@ -13,4 +13,4 @@ using cc::PaintTextBlob;
using cc::PaintTextBlobBuilder;
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_TEXT_BLOB_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_TEXT_BLOB_H_
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_TYPEFACE_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_TYPEFACE_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_TYPEFACE_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_TYPEFACE_H_
#include "cc/paint/paint_typeface.h"
......@@ -11,4 +11,4 @@ namespace blink {
using cc::PaintTypeface;
}
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_PAINT_TYPEFACE_H_
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_PAINT_TYPEFACE_H_
......@@ -7,11 +7,11 @@
#include "third_party/blink/renderer/platform/fonts/canvas_rotation_in_vertical.h"
#include "third_party/blink/renderer/platform/fonts/glyph.h"
#include "third_party/blink/renderer/platform/fonts/paint_text_blob.h"
#include "third_party/blink/renderer/platform/fonts/paint_typeface.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/geometry/float_point.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_text_blob.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_typeface.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
......
......@@ -10,11 +10,11 @@
#include "third_party/blink/renderer/platform/fonts/character_range.h"
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h"
#include "third_party/blink/renderer/platform/fonts/paint_typeface.h"
#include "third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/fonts/text_run_paint_info.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_typeface.h"
namespace blink {
......
......@@ -45,7 +45,6 @@
#include "third_party/blink/renderer/platform/fonts/font_global_context.h"
#include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/language.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
......
......@@ -34,7 +34,6 @@
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/web_font_typeface_factory.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/shared_buffer.h"
......
......@@ -7,7 +7,7 @@
#include "build/build_config.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/font_description.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_font.h"
#include "third_party/blink/renderer/platform/fonts/paint_font.h"
#include "third_party/blink/renderer/platform/layout_test_support.h"
namespace blink {
......
......@@ -34,8 +34,6 @@
#include <windows.h>
#include "SkTypeface.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/layout_test_support.h"
namespace blink {
......
......@@ -6,10 +6,10 @@
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_TEST_MOCK_PAINT_CANVAS_H_
#include "cc/paint/paint_canvas.h"
#include "cc/paint/paint_text_blob.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_flags.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_text_blob.h"
#include "third_party/skia/include/core/SkMetaData.h"
namespace blink {
......@@ -82,7 +82,7 @@ class MockPaintCanvas : public cc::PaintCanvas {
SkScalar top,
const PaintFlags* flags));
MOCK_METHOD4(drawTextBlob,
void(scoped_refptr<PaintTextBlob>,
void(scoped_refptr<cc::PaintTextBlob>,
SkScalar x,
SkScalar y,
const PaintFlags& flags));
......
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