Fix CanvasKit warnings compiling on Mac with emsdk 2.0.0

Change-Id: Idcb37644c6c657ce66390ae12d9a55d68abab6cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317642
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Chris Dalton 2020-09-18 13:27:35 -06:00 committed by Skia Commit-Bot
parent 910845fac1
commit 597c33a8c0
6 changed files with 20 additions and 4 deletions

View File

@ -34,6 +34,7 @@ enum GrDriverBugWorkaroundType {
class SK_API GrDriverBugWorkarounds {
public:
GrDriverBugWorkarounds();
GrDriverBugWorkarounds(const GrDriverBugWorkarounds&) = default;
explicit GrDriverBugWorkarounds(const std::vector<int32_t>& workarounds);
GrDriverBugWorkarounds& operator=(const GrDriverBugWorkarounds&) = default;

View File

@ -262,6 +262,10 @@ set -e
echo "Compiling bitcode"
# With emsdk 2.0.0 we get a false positive on tautological-value-range-compare. This appears to be
# fixed in the emsdk 2.0.4 toolchain. Disable the warning while we maintain support for 2.0.0.
EXTRA_CFLAGS+="\"-Wno-tautological-value-range-compare\""
# Inspired by https://github.com/Zubnix/skia-wasm-port/blob/master/build_bindings.sh
./bin/gn gen ${BUILD_DIR} \
--args="cc=\"${EMCC}\" \
@ -328,6 +332,14 @@ export EMCC_CLOSURE_ARGS="--externs $BASE_DIR/externs.js "
echo "Generating final wasm"
# Disable '-s STRICT=1' outside of Linux until
# https://github.com/emscripten-core/emscripten/issues/12118 is resovled.
STRICTNESS="-s STRICT=1"
if [[ `uname` != "Linux" ]]; then
echo "Disabling '-s STRICT=1'. See: https://github.com/emscripten-core/emscripten/issues/12118"
STRICTNESS=""
fi
# Emscripten prefers that the .a files go last in order, otherwise, it
# may drop symbols that it incorrectly thinks aren't used. One day,
# Emscripten will use LLD, which may relax this requirement.
@ -380,8 +392,8 @@ EMCC_DEBUG=1 ${EMCXX} \
-s FILESYSTEM=0 \
-s MODULARIZE=1 \
-s NO_EXIT_RUNTIME=1 \
-s STRICT=1 \
-s INITIAL_MEMORY=128MB \
-s WARN_UNALIGNED=1 \
-s WASM=1 \
$STRICTNESS \
-o $BUILD_DIR/canvaskit.js

View File

@ -18,6 +18,7 @@ class CompositionBuilder;
class LayerBuilder final {
public:
LayerBuilder(const skjson::ObjectValue& jlayer, const SkSize& comp_size);
LayerBuilder(const LayerBuilder&) = default;
~LayerBuilder();
int index() const { return fIndex; }

View File

@ -150,8 +150,6 @@ class TextureUploadSample : public Sample {
}
};
const int TextureUploadSample::kMinTileSize;
const int TextureUploadSample::kMaxTileSize;
DEF_SAMPLE( return new TextureUploadSample(); )

View File

@ -35,6 +35,9 @@ struct Symbol : public IRNode {
SkASSERT(kind >= Kind::kFirst && kind <= Kind::kLast);
}
Symbol(const Symbol&) = default;
Symbol& operator=(const Symbol&) = default;
~Symbol() override {}
Kind kind() const {

View File

@ -1,6 +1,7 @@
// Copyright 2018 Google LLC.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#include "include/private/SkTFitsIn.h"
#include "src/utils/SkUTF.h"
#include <climits>
@ -94,7 +95,7 @@ int SkUTF::CountUTF16(const uint16_t* utf16, size_t byteLength) {
}
int SkUTF::CountUTF32(const int32_t* utf32, size_t byteLength) {
if (!is_align4(intptr_t(utf32)) || !is_align4(byteLength) || byteLength >> 2 > INT_MAX) {
if (!is_align4(intptr_t(utf32)) || !is_align4(byteLength) || !SkTFitsIn<int>(byteLength >> 2)) {
return -1;
}
const uint32_t kInvalidUnicharMask = 0xFF000000; // unichar fits in 24 bits