Thanks to visit codestin.com
Credit goes to github.com

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
4 changes: 2 additions & 2 deletions ink/color/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ cc_library(
],
deps = [
":color_space",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings:str_format",
],
)
Expand Down Expand Up @@ -62,7 +62,7 @@ cc_library(
srcs = ["color_space.cc"],
hdrs = ["color_space.h"],
deps = [
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings:str_format",
],
)
Expand Down
6 changes: 3 additions & 3 deletions ink/color/color.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <string>

#include "absl/log/absl_check.h"
#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"
#include "ink/color/color_space.h"

Expand Down Expand Up @@ -59,7 +59,7 @@ Color Color::FromFloat(float red, float green, float blue, float alpha,
(red != 0.0f || green != 0.0f || blue != 0.0f)) {
// If alpha is zero and the inputs were correctly premultiplied, then all
// color channels must necessarily be zero too.
LOG(FATAL) << absl::StrFormat(
ABSL_LOG(FATAL) << absl::StrFormat(
"Premultiplied alpha=0 must have RGB=0. Got RGBA={%f, %f, %f, %f}.",
red, green, blue, alpha);
}
Expand All @@ -86,7 +86,7 @@ Color Color::FromUint8(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha,
(red != 0 || green != 0 || blue != 0)) {
// If alpha is zero and the inputs were correctly premultiplied, then all
// color channels must necessarily be zero too.
LOG(FATAL) << absl::StrFormat(
ABSL_LOG(FATAL) << absl::StrFormat(
"Premultiplied alpha=0 must have RGB=0. Got RGBA={%d, %d, %d, %d}.",
red, green, blue, alpha);
}
Expand Down
16 changes: 10 additions & 6 deletions ink/color/color_space.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <cmath>
#include <string>

#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"

namespace ink {
Expand Down Expand Up @@ -73,7 +73,8 @@ std::array<double, 9> GetFromXyzD65(ColorSpace space) {
case ColorSpace::kDisplayP3:
return kXyzD65ToDisplayP3;
}
LOG(DFATAL) << "Unknown ColorSpace enum value " << static_cast<int>(space);
ABSL_LOG(DFATAL) << "Unknown ColorSpace enum value "
<< static_cast<int>(space);
return {};
}

Expand All @@ -84,7 +85,8 @@ std::array<double, 9> GetToXyzD65(ColorSpace space) {
case ColorSpace::kDisplayP3:
return kDisplayP3ToXyzD65;
}
LOG(DFATAL) << "Unknown ColorSpace enum value " << static_cast<int>(space);
ABSL_LOG(DFATAL) << "Unknown ColorSpace enum value "
<< static_cast<int>(space);
return {};
}

Expand All @@ -101,7 +103,8 @@ float GammaDecode(float encoded_value, ColorSpace space) {
return std::pow(kSrgbA * encoded_value + kSrgbB, kSrgbG);
}
}
LOG(DFATAL) << "Unknown ColorSpace enum value " << static_cast<int>(space);
ABSL_LOG(DFATAL) << "Unknown ColorSpace enum value "
<< static_cast<int>(space);
return 0.0f;
}

Expand All @@ -116,7 +119,8 @@ float GammaEncode(float linear_value, ColorSpace space) {
return (std::pow(linear_value, 1.0 / kSrgbG) - kSrgbB) / kSrgbA;
}
}
LOG(DFATAL) << "Unknown ColorSpace enum value " << static_cast<int>(space);
ABSL_LOG(DFATAL) << "Unknown ColorSpace enum value "
<< static_cast<int>(space);
return 0.0f;
}

Expand Down Expand Up @@ -169,7 +173,7 @@ std::array<float, 5> GetGammaDecodingParameters(ColorSpace space) {
return {kSrgbA, kSrgbB, kSrgbC, kSrgbD, kSrgbG};
}
}
LOG(DFATAL) << "Unknown ColorSpace enum value " << space;
ABSL_LOG(DFATAL) << "Unknown ColorSpace enum value " << space;
return {};
}

Expand Down
4 changes: 2 additions & 2 deletions ink/geometry/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ cc_library(
":rect",
":segment",
":vec",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
],
)

Expand Down Expand Up @@ -417,7 +417,7 @@ cc_library(
"//ink/types:small_array",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
Expand Down
2 changes: 1 addition & 1 deletion ink/geometry/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ cc_library(
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
Expand Down
8 changes: 4 additions & 4 deletions ink/geometry/internal/mesh_packing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "absl/container/flat_hash_set.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/absl_check.h"
#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/substitute.h"
Expand Down Expand Up @@ -664,7 +664,7 @@ SmallArray<uint32_t, 4> UnpackIntegersFromPackedAttribute(
case MeshFormat::AttributeType::kFloat4Unpacked:
break;
}
LOG(FATAL) << "Non-packed AttributeType: " << static_cast<uint8_t>(type);
ABSL_LOG(FATAL) << "Non-packed AttributeType: " << static_cast<uint8_t>(type);
}

SmallArray<float, 4> ReadFloatsFromUnpackedAttribute(
Expand All @@ -690,7 +690,7 @@ SmallArray<float, 4> ReadFloatsFromUnpackedAttribute(
case MeshFormat::AttributeType::kFloat4PackedIn3Floats:
break;
}
LOG(FATAL) << "Packed AttributeType: " << static_cast<uint8_t>(type);
ABSL_LOG(FATAL) << "Packed AttributeType: " << static_cast<uint8_t>(type);
}

std::array<uint32_t, 3> ReadTriangleIndicesFromByteArray(
Expand Down Expand Up @@ -780,7 +780,7 @@ SmallArray<float, 4> ReadUnpackedFloatAttributeFromByteArray(
UnalignedLoadFloat(src + 3 * sizeof(float)),
};
}
LOG(FATAL) << "Unrecognized AttributeType: " << attr.type;
ABSL_LOG(FATAL) << "Unrecognized AttributeType: " << attr.type;
}

absl::InlinedVector<PartitionInfo, 1> PartitionTriangles(
Expand Down
13 changes: 7 additions & 6 deletions ink/geometry/mesh_format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "absl/algorithm/container.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
Expand Down Expand Up @@ -201,7 +201,7 @@ uint8_t MeshFormat::ComponentCount(AttributeType type) {
case AttributeType::kFloat4PackedIn3Floats:
return 4;
}
LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
ABSL_LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
}

std::optional<SmallArray<uint8_t, 4>> MeshFormat::PackedBitsPerComponent(
Expand Down Expand Up @@ -232,7 +232,7 @@ std::optional<SmallArray<uint8_t, 4>> MeshFormat::PackedBitsPerComponent(
case AttributeType::kFloat4PackedIn3Floats:
return SmallArray<uint8_t, 4>({18, 18, 18, 18});
}
LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
ABSL_LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
}

uint8_t MeshFormat::UnpackedAttributeSize(AttributeType type) {
Expand All @@ -258,7 +258,7 @@ bool MeshFormat::IsPackedAsFloat(AttributeType type) {
case MeshFormat::AttributeType::kFloat3PackedIn4UnsignedBytes_XYZ10:
return false;
}
LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
ABSL_LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
}

uint8_t MeshFormat::PackedAttributeSize(AttributeType type) {
Expand All @@ -284,7 +284,7 @@ uint8_t MeshFormat::PackedAttributeSize(AttributeType type) {
case AttributeType::kFloat4Unpacked:
return 16;
}
LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
ABSL_LOG(FATAL) << "Unrecognized AttributeType " << static_cast<int>(type);
}

uint8_t MeshFormat::UnpackedIndexSize(IndexFormat index_format) {
Expand All @@ -294,7 +294,8 @@ uint8_t MeshFormat::UnpackedIndexSize(IndexFormat index_format) {
case IndexFormat::k32BitUnpacked16BitPacked:
return 4;
}
LOG(FATAL) << "Unrecognized IndexFormat " << static_cast<int>(index_format);
ABSL_LOG(FATAL) << "Unrecognized IndexFormat "
<< static_cast<int>(index_format);
}

void MeshFormat::PopulateOffsetWidthAndStride() {
Expand Down
4 changes: 2 additions & 2 deletions ink/geometry/quad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <optional>
#include <utility>

#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "ink/geometry/angle.h"
#include "ink/geometry/point.h"
#include "ink/geometry/segment.h"
Expand Down Expand Up @@ -62,7 +62,7 @@ Segment Quad::GetEdge(int index) const {
case 3:
return Segment{corners[3], corners[0]};
default:
LOG(FATAL) << "Index " << index << " out of bounds";
ABSL_LOG(FATAL) << "Index " << index << " out of bounds";
}
}

Expand Down
2 changes: 1 addition & 1 deletion ink/rendering/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cc_library(
deps = [
"//ink/color",
"//ink/color:color_space",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
Expand Down
4 changes: 2 additions & 2 deletions ink/rendering/bitmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <cstddef>
#include <string>

#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"

Expand Down Expand Up @@ -76,7 +76,7 @@ size_t PixelFormatBytesPerPixel(Bitmap::PixelFormat format) {
case Bitmap::PixelFormat::kRgba8888:
return 4;
}
LOG(FATAL) << "Invalid PixelFormat value: " << static_cast<int>(format);
ABSL_LOG(FATAL) << "Invalid PixelFormat value: " << static_cast<int>(format);
}

} // namespace ink
1 change: 0 additions & 1 deletion ink/rendering/skia/common_internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ cc_library(
"//ink/strokes/internal:stroke_vertex",
"//ink/types:small_array",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "absl/container/inlined_vector.h"
#include "absl/log/absl_check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
Expand Down
4 changes: 2 additions & 2 deletions ink/strokes/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ cc_library(
"//ink/strokes/internal:stroke_shape_builder",
"//ink/strokes/internal:stroke_vertex",
"//ink/types:duration",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/types:span",
],
Expand Down Expand Up @@ -117,8 +117,8 @@ cc_library(
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:span",
Expand Down
6 changes: 3 additions & 3 deletions ink/strokes/in_progress_stroke.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "absl/algorithm/container.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/absl_check.h"
#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "absl/types/span.h"
Expand Down Expand Up @@ -245,8 +245,8 @@ Stroke InProgressStroke::CopyToStroke(
if (modeled_shape.ok()) {
return Stroke(*brush, processed_inputs_.MakeDeepCopy(), *modeled_shape);
} else {
LOG(WARNING) << "Failed to create ModeledShape for InProgressStroke: "
<< modeled_shape.status();
ABSL_LOG(WARNING) << "Failed to create ModeledShape for InProgressStroke: "
<< modeled_shape.status();
return Stroke(*brush, processed_inputs_.MakeDeepCopy(),
ModeledShape::WithEmptyGroups(brush->CoatCount()));
}
Expand Down
4 changes: 2 additions & 2 deletions ink/strokes/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ cc_library(
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/types:span",
],
)
Expand Down Expand Up @@ -197,8 +197,8 @@ cc_library(
"//ink/geometry/internal:algorithms",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/functional:overload",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings",
],
)
Expand Down
18 changes: 10 additions & 8 deletions ink/strokes/internal/brush_tip_modeler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "absl/base/nullability.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/absl_check.h"
#include "absl/log/log.h"
#include "absl/log/absl_log.h"
#include "absl/types/span.h"
#include "ink/brush/brush_behavior.h"
#include "ink/brush/brush_tip.h"
Expand Down Expand Up @@ -57,8 +57,9 @@ float InitialTargetModifierValue(BrushBehavior::Target target) {
case BrushBehavior::Target::kLuminosity:
return 0.f;
}
LOG(FATAL) << "`target` should not be able to have non-enumerator value: "
<< static_cast<int>(target);
ABSL_LOG(FATAL)
<< "`target` should not be able to have non-enumerator value: "
<< static_cast<int>(target);
}

bool SourceOutOfRangeBehaviorHasUpperBound(
Expand All @@ -70,9 +71,10 @@ bool SourceOutOfRangeBehaviorHasUpperBound(
case BrushBehavior::OutOfRange::kMirror:
return false;
}
LOG(FATAL) << "`source_out_of_range_behavior` should not be able to have: "
"non-enumerator value: "
<< static_cast<int>(source_out_of_range_behavior);
ABSL_LOG(FATAL)
<< "`source_out_of_range_behavior` should not be able to have: "
"non-enumerator value: "
<< static_cast<int>(source_out_of_range_behavior);
}

// Returns the upper bound for values of input source that are affected by this
Expand Down Expand Up @@ -140,7 +142,7 @@ float DistanceRemainingUpperBound(const BrushBehavior::SourceNode& node,
kInputAccelerationLateralInCentimetersPerSecondSquared:
return 0;
}
LOG(FATAL)
ABSL_LOG(FATAL)
<< "`node.source` should not be able to have non-enumerator value: "
<< static_cast<int>(node.source);
}
Expand Down Expand Up @@ -199,7 +201,7 @@ Duration32 TimeRemainingUpperBound(const BrushBehavior::SourceNode& node) {
kInputAccelerationLateralInCentimetersPerSecondSquared:
return Duration32::Zero();
}
LOG(FATAL)
ABSL_LOG(FATAL)
<< "`node.source` should not be able to have non-enumerator value: "
<< static_cast<int>(node.source);
}
Expand Down
Loading