Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ vars = {
'skia_git': 'https://skia.googlesource.com',
# OCMock is for testing only so there is no google clone
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
'skia_revision': 'b3275e1fd64cbbf57a1e9a2ecb2db0812cfba4dc',
'skia_revision': 'c71ae5140090290ad16b73bdb0aa6f4543c64a78',

# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
Expand Down Expand Up @@ -116,7 +116,7 @@ deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '8cbf38af7d48cc298ae86e614533b4b2d0dc6758',

'src/flutter/impeller':
Var('github_git') + '/flutter/impeller' + '@' + '144d29b12def5058b34c910b5f0343f5355a968d',
Var('github_git') + '/flutter/impeller' + '@' + '114e92d2d046b3496f2b9422946295efaae676dd',

# Fuchsia compatibility
#
Expand Down Expand Up @@ -618,7 +618,7 @@ deps = {
'packages': [
{
'package': 'fuchsia/sdk/core/mac-amd64',
'version': 'XGk8f98vkWo3LGch7wRT3bjpTDEnC1BPjJy1zAGiDqEC'
'version': '5VwmuFnNNvR_3XAVU9Fo51Q0nLkRzeSZHYIOW_omotwC'
}
],
'condition': 'host_os == "mac" and not download_fuchsia_sdk',
Expand All @@ -628,7 +628,7 @@ deps = {
'packages': [
{
'package': 'fuchsia/sdk/core/linux-amd64',
'version': 'bltm6P1RVx6jzhhgmH8-BkzYE4v9iICn_QQ0IUMifCMC'
'version': '-T9kCGaceQI0js1gCuXCStBjE0cnE4kWHe-HCPhuzLQC'
}
],
'condition': 'host_os == "linux" and not download_fuchsia_sdk',
Expand Down Expand Up @@ -661,6 +661,12 @@ deps = {
}

hooks = [
{
# Generate the Dart SDK's .dart_tool/package_confg.json file.
'name': 'Generate .dart_tool/package_confg.json',
'pattern': '.',
'action': ['python3', 'src/third_party/dart/tools/generate_package_config.py'],
},
{
# Update the Windows toolchain if necessary.
'name': 'win_toolchain',
Expand Down
2 changes: 2 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ FILE: ../../../flutter/display_list/display_list_benchmarks_metal.cc
FILE: ../../../flutter/display_list/display_list_benchmarks_metal.h
FILE: ../../../flutter/display_list/display_list_benchmarks_software.cc
FILE: ../../../flutter/display_list/display_list_benchmarks_software.h
FILE: ../../../flutter/display_list/display_list_blend_mode.cc
FILE: ../../../flutter/display_list/display_list_blend_mode.h
FILE: ../../../flutter/display_list/display_list_builder.cc
FILE: ../../../flutter/display_list/display_list_builder.h
FILE: ../../../flutter/display_list/display_list_canvas_dispatcher.cc
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_fuchsia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 1619b0f17059554286b4f006025815a0
Signature: 8d1b2cec132d08723316cc285e616cf7

UNUSED LICENSES:

Expand Down
77 changes: 40 additions & 37 deletions ci/licenses_golden/licenses_skia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: c7fac558647a8e390ec8aa2b48044b1b
Signature: bf29309505065797ffef77b5ad71374d

UNUSED LICENSES:

Expand Down Expand Up @@ -6097,6 +6097,8 @@ FILE: ../../../third_party/skia/experimental/graphite/src/render/MiddleOutFanRen
FILE: ../../../third_party/skia/experimental/graphite/src/render/StencilAndCoverDSS.h
FILE: ../../../third_party/skia/experimental/graphite/src/render/TessellateCurvesRenderStep.cpp
FILE: ../../../third_party/skia/experimental/graphite/src/render/TessellateCurvesRenderStep.h
FILE: ../../../third_party/skia/experimental/graphite/src/render/TessellateWedgesRenderStep.cpp
FILE: ../../../third_party/skia/experimental/graphite/src/render/TessellateWedgesRenderStep.h
FILE: ../../../third_party/skia/gm/bug12866.cpp
FILE: ../../../third_party/skia/include/core/SkAlphaType.h
FILE: ../../../third_party/skia/include/core/SkColorType.h
Expand Down Expand Up @@ -7773,13 +7775,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

====================================================================================================
LIBRARY: skia
ORIGIN: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/gpu/tessellate/MidpointContourParser.h + ../../../third_party/skia/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp
FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.h
FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp
FILE: ../../../third_party/skia/src/gpu/tessellate/MidpointContourParser.h
FILE: ../../../third_party/skia/src/sksl/SkSLPosition.cpp
----------------------------------------------------------------------------------------------------
Copyright 2009-2015 Google Inc.
Copyright 2022 Google LLC.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -7812,13 +7813,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

====================================================================================================
LIBRARY: skia
ORIGIN: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp + ../../../third_party/skia/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.h
FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp
FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.h
FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp
----------------------------------------------------------------------------------------------------
Copyright 2006-2012 The Android Open Source Project
Copyright 2012 Mozilla Foundation
Copyright 2009-2015 Google Inc.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -7851,11 +7852,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

====================================================================================================
LIBRARY: skia
ORIGIN: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp + ../../../third_party/skia/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp
FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.h
----------------------------------------------------------------------------------------------------
Copyright 2011 Google Inc.
Copyright 2006-2012 The Android Open Source Project
Copyright 2012 Mozilla Foundation

Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -7889,31 +7891,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

====================================================================================================
LIBRARY: skia
ORIGIN: ../../../third_party/skia/src/sksl/GLSL.std.450.h
TYPE: LicenseType.unknown
FILE: ../../../third_party/skia/src/sksl/GLSL.std.450.h
FILE: ../../../third_party/skia/src/sksl/spirv.h
----------------------------------------------------------------------------------------------------
Copyright (c) 2014-2016 The Khronos Group Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and/or associated documentation files (the "Materials"),
to deal in the Materials without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Materials, and to permit persons to whom the
Materials are furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Materials.
====================================================================================================

====================================================================================================
LIBRARY: skia
ORIGIN: ../../../third_party/skia/src/sksl/SkSLPosition.cpp + ../../../third_party/skia/LICENSE
ORIGIN: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp + ../../../third_party/skia/LICENSE
TYPE: LicenseType.bsd
FILE: ../../../third_party/skia/src/sksl/SkSLPosition.cpp
FILE: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp
----------------------------------------------------------------------------------------------------
Copyright 2022 Google LLC.
Copyright 2011 Google Inc.
Copyright 2012 Mozilla Foundation

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -7944,6 +7927,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================================================

====================================================================================================
LIBRARY: skia
ORIGIN: ../../../third_party/skia/src/sksl/GLSL.std.450.h
TYPE: LicenseType.unknown
FILE: ../../../third_party/skia/src/sksl/GLSL.std.450.h
FILE: ../../../third_party/skia/src/sksl/spirv.h
----------------------------------------------------------------------------------------------------
Copyright (c) 2014-2016 The Khronos Group Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and/or associated documentation files (the "Materials"),
to deal in the Materials without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Materials, and to permit persons to whom the
Materials are furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Materials.
====================================================================================================

====================================================================================================
LIBRARY: vulkanmemoryallocator
ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h
Expand Down
2 changes: 2 additions & 0 deletions display_list/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ source_set("display_list") {
"display_list.cc",
"display_list.h",
"display_list_attributes.h",
"display_list_blend_mode.cc",
"display_list_blend_mode.h",
"display_list_builder.cc",
"display_list_builder.h",
"display_list_canvas_dispatcher.cc",
Expand Down
2 changes: 1 addition & 1 deletion display_list/display_list_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ void BM_DrawVertices(benchmark::State& state,
sk_sp<SkVertices> vertices =
GetTestVertices(p, radius, 50, mode, vertex_count);
total_vertex_count += vertex_count;
builder.drawVertices(vertices, SkBlendMode::kSrc);
builder.drawVertices(vertices, DlBlendMode::kSrc);
}

state.counters["VertexCount"] = total_vertex_count;
Expand Down
7 changes: 7 additions & 0 deletions display_list/display_list_blend_mode.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "flutter/display_list/display_list_blend_mode.h"

namespace flutter {} // namespace flutter
78 changes: 78 additions & 0 deletions display_list/display_list_blend_mode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef FLUTTER_DISPLAY_LIST_DISPLAY_LIST_BLEND_MODE_H_
#define FLUTTER_DISPLAY_LIST_DISPLAY_LIST_BLEND_MODE_H_

#include "include/core/SkBlender.h"

namespace flutter {

/// A enum define the blend mode.
/// Blends are operators that take in two colors (source, destination) and
/// return a new color. Blends are operators that take in two colors (source,
/// destination) and return a new color. Many of these operate the same on all 4
/// components: red, green, blue, alpha. For these, we just document what
/// happens to one component, rather than naming each one separately. Different
/// SkColorTypes have different representations for color components:
/// 8-bit: 0..255
/// 6-bit: 0..63
/// 5-bit: 0..31
/// 4-bit: 0..15
/// floats: 0...1
/// The documentation is expressed as if the component values are always 0..1
/// (floats). For brevity, the documentation uses the following abbreviations s
/// : source d : destination sa : source alpha da : destination alpha Results
/// are abbreviated r : if all 4 components are computed in the same manner ra
/// : result alpha component rc : result "color": red, green, blue components
enum class DlBlendMode {
kClear, //!< r = 0
kSrc, //!< r = s
kDst, //!< r = d
kSrcOver, //!< r = s + (1-sa)*d
kDstOver, //!< r = d + (1-da)*s
kSrcIn, //!< r = s * da
kDstIn, //!< r = d * sa
kSrcOut, //!< r = s * (1-da)
kDstOut, //!< r = d * (1-sa)
kSrcATop, //!< r = s*da + d*(1-sa)
kDstATop, //!< r = d*sa + s*(1-da)
kXor, //!< r = s*(1-da) + d*(1-sa)
kPlus, //!< r = min(s + d, 1)
kModulate, //!< r = s*d
kScreen, //!< r = s + d - s*d

kOverlay, //!< multiply or screen, depending on destination
kDarken, //!< rc = s + d - max(s*da, d*sa), ra = kSrcOver
kLighten, //!< rc = s + d - min(s*da, d*sa), ra = kSrcOver
kColorDodge, //!< brighten destination to reflect source
kColorBurn, //!< darken destination to reflect source
kHardLight, //!< multiply or screen, depending on source
kSoftLight, //!< lighten or darken, depending on source
kDifference, //!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
kExclusion, //!< rc = s + d - two(s*d), ra = kSrcOver
kMultiply, //!< r = s*(1-da) + d*(1-sa) + s*d

kHue, //!< hue of source with saturation and luminosity of destination
kSaturation, //!< saturation of source with hue and luminosity of destination
kColor, //!< hue and saturation of source with luminosity of destination
kLuminosity, //!< luminosity of source with hue and saturation of destination

kLastCoeffMode = kScreen, //!< last porter duff blend mode
kLastSeparableMode =
kMultiply, //!< last blend mode operating separately on components
kLastMode = kLuminosity, //!< last valid value
};

inline DlBlendMode ToDl(SkBlendMode mode) {
return static_cast<DlBlendMode>(mode);
}

inline SkBlendMode ToSk(DlBlendMode mode) {
return static_cast<SkBlendMode>(mode);
}

} // namespace flutter

#endif // FLUTTER_DISPLAY_LIST_DISPLAY_LIST_BLEND_MODE_H_
13 changes: 7 additions & 6 deletions display_list/display_list_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "flutter/display_list/display_list_builder.h"

#include "flutter/display_list/display_list_blend_mode.h"
#include "flutter/display_list/display_list_ops.h"

namespace flutter {
Expand Down Expand Up @@ -103,7 +104,7 @@ void DisplayListBuilder::onSetStrokeMiter(SkScalar limit) {
void DisplayListBuilder::onSetColor(SkColor color) {
Push<SetColorOp>(0, 0, current_color_ = color);
}
void DisplayListBuilder::onSetBlendMode(SkBlendMode mode) {
void DisplayListBuilder::onSetBlendMode(DlBlendMode mode) {
current_blender_ = nullptr;
Push<SetBlendModeOp>(0, 0, current_blend_mode_ = mode);
UpdateCurrentOpacityCompatibility();
Expand All @@ -115,7 +116,7 @@ void DisplayListBuilder::onSetBlender(sk_sp<SkBlender> blender) {
SkPaint p;
p.setBlender(blender);
if (p.asBlendMode()) {
setBlendMode(p.asBlendMode().value());
setBlendMode(ToDl(p.asBlendMode().value()));
} else {
// |current_blender_| supersedes any value of |current_blend_mode_|
(current_blender_ = blender) //
Expand Down Expand Up @@ -263,7 +264,7 @@ void DisplayListBuilder::setAttributesFromPaint(
if (flags.applies_blend()) {
std::optional<SkBlendMode> mode_optional = paint.asBlendMode();
if (mode_optional) {
setBlendMode(mode_optional.value());
setBlendMode(ToDl(mode_optional.value()));
} else {
setBlender(sk_ref_sp(paint.getBlender()));
}
Expand Down Expand Up @@ -479,7 +480,7 @@ void DisplayListBuilder::drawPaint() {
Push<DrawPaintOp>(0, 1);
CheckLayerOpacityCompatibility();
}
void DisplayListBuilder::drawColor(SkColor color, SkBlendMode mode) {
void DisplayListBuilder::drawColor(SkColor color, DlBlendMode mode) {
Push<DrawColorOp>(0, 1, color, mode);
CheckLayerOpacityCompatibility(mode);
}
Expand Down Expand Up @@ -559,7 +560,7 @@ void DisplayListBuilder::drawPoints(SkCanvas::PointMode mode,
UpdateLayerOpacityCompatibility(false);
}
void DisplayListBuilder::drawVertices(const sk_sp<SkVertices> vertices,
SkBlendMode mode) {
DlBlendMode mode) {
Push<DrawVerticesOp>(0, 1, std::move(vertices), mode);
// DrawVertices applies its colors to the paint so we have no way
// of controlling opacity using the current paint attributes.
Expand Down Expand Up @@ -625,7 +626,7 @@ void DisplayListBuilder::drawAtlas(const sk_sp<SkImage> atlas,
const SkRect tex[],
const SkColor colors[],
int count,
SkBlendMode mode,
DlBlendMode mode,
const SkSamplingOptions& sampling,
const SkRect* cull_rect,
bool render_with_attributes) {
Expand Down
Loading