Skip to content
Permalink
Browse files
Update Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7d…
…ec91c

https://bugs.webkit.org/show_bug.cgi?id=177994

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-05
Reviewed by Michael Catanzaro.

Source/ThirdParty:

* woff2/CMakeLists.txt: Also consider the directory for public headers.
* woff2/README.webkit:
* woff2/include/woff2/decode.h: Renamed from Source/ThirdParty/woff2/src/woff2_dec.h.
* woff2/include/woff2/encode.h: Renamed from Source/ThirdParty/woff2/src/woff2_enc.h.
(woff2::WOFF2Params::WOFF2Params):
* woff2/include/woff2/output.h: Renamed from Source/ThirdParty/woff2/src/woff2_out.h.
(woff2::WOFF2Out::~WOFF2Out):
(woff2::WOFF2StringOut::MaxSize):
* woff2/src/buffer.h:
* woff2/src/convert_woff2ttf_*.cc:
* woff2/src/file.h:
* woff2/src/font.cc:
* woff2/src/font.h:
* woff2/src/glyph.cc:
* woff2/src/glyph.h:
* woff2/src/normalize.cc:
* woff2/src/normalize.h:
* woff2/src/port.h:
* woff2/src/round.h:
* woff2/src/store_bytes.h:
* woff2/src/table_tags.cc:
* woff2/src/table_tags.h:
* woff2/src/transform.cc:
* woff2/src/transform.h:
* woff2/src/variable_length.cc:
* woff2/src/variable_length.h:
* woff2/src/woff2_common.cc:
* woff2/src/woff2_common.h:
* woff2/src/woff2_compress.cc:
* woff2/src/woff2_dec.cc:
* woff2/src/woff2_decompress.cc:
* woff2/src/woff2_enc.cc:
* woff2/src/woff2_info.cc:
* woff2/src/woff2_out.cc:
* woff2/update.sh: Also consider directory for public headers.

Source/WebCore:

No new tests, already covered by existing tests.

* CMakeLists.txt: Include the directory for public headers instead.
* platform/graphics/WOFFFileFormat.cpp: Use the public header
woff2/decode.h and do not use the "wOF2" constant from private headers.
(WebCore::isWOFF):
(WebCore::convertWOFFToSfnt):

Canonical link: https://commits.webkit.org/194232@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
fred-wang authored and webkit-commit-queue committed Oct 6, 2017
1 parent 29deeb4 commit e8faeffa22b2166b3a19aa85bb8c487e1f685336
Showing with 289 additions and 474 deletions.
  1. +43 −0 Source/ThirdParty/ChangeLog
  2. +1 −0 Source/ThirdParty/woff2/CMakeLists.txt
  3. +1 −1 Source/ThirdParty/woff2/README.webkit
  4. +8 −16 Source/ThirdParty/woff2/{src/woff2_dec.h → include/woff2/decode.h}
  5. +9 −20 Source/ThirdParty/woff2/{src/woff2_enc.h → include/woff2/encode.h}
  6. +9 −37 Source/ThirdParty/woff2/{src/woff2_out.h → include/woff2/output.h}
  7. +8 −16 Source/ThirdParty/woff2/src/buffer.h
  8. +1 −1 Source/ThirdParty/woff2/src/convert_woff2ttf_fuzzer.cc
  9. +1 −1 Source/ThirdParty/woff2/src/convert_woff2ttf_fuzzer_new_entry.cc
  10. +7 −15 Source/ThirdParty/woff2/src/file.h
  11. +7 −15 Source/ThirdParty/woff2/src/font.cc
  12. +8 −16 Source/ThirdParty/woff2/src/font.h
  13. +7 −15 Source/ThirdParty/woff2/src/glyph.cc
  14. +8 −16 Source/ThirdParty/woff2/src/glyph.h
  15. +7 −15 Source/ThirdParty/woff2/src/normalize.cc
  16. +9 −17 Source/ThirdParty/woff2/src/normalize.h
  17. +7 −15 Source/ThirdParty/woff2/src/port.h
  18. +7 −15 Source/ThirdParty/woff2/src/round.h
  19. +8 −16 Source/ThirdParty/woff2/src/store_bytes.h
  20. +7 −15 Source/ThirdParty/woff2/src/table_tags.cc
  21. +7 −15 Source/ThirdParty/woff2/src/table_tags.h
  22. +7 −15 Source/ThirdParty/woff2/src/transform.cc
  23. +7 −15 Source/ThirdParty/woff2/src/transform.h
  24. +7 −15 Source/ThirdParty/woff2/src/variable_length.cc
  25. +7 −15 Source/ThirdParty/woff2/src/variable_length.h
  26. +7 −15 Source/ThirdParty/woff2/src/woff2_common.cc
  27. +7 −15 Source/ThirdParty/woff2/src/woff2_common.h
  28. +8 −16 Source/ThirdParty/woff2/src/woff2_compress.cc
  29. +10 −18 Source/ThirdParty/woff2/src/woff2_dec.cc
  30. +9 −17 Source/ThirdParty/woff2/src/woff2_decompress.cc
  31. +11 −19 Source/ThirdParty/woff2/src/woff2_enc.cc
  32. +7 −15 Source/ThirdParty/woff2/src/woff2_info.cc
  33. +10 −16 Source/ThirdParty/woff2/src/woff2_out.cc
  34. +2 −1 Source/ThirdParty/woff2/update.sh
  35. +1 −1 Source/WebCore/CMakeLists.txt
  36. +15 −0 Source/WebCore/ChangeLog
  37. +4 −4 Source/WebCore/platform/graphics/WOFFFileFormat.cpp
@@ -1,3 +1,46 @@
2017-10-05 Frederic Wang <fwang@igalia.com>

Update Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7dec91c
https://bugs.webkit.org/show_bug.cgi?id=177994

Reviewed by Michael Catanzaro.

* woff2/CMakeLists.txt: Also consider the directory for public headers.
* woff2/README.webkit:
* woff2/include/woff2/decode.h: Renamed from Source/ThirdParty/woff2/src/woff2_dec.h.
* woff2/include/woff2/encode.h: Renamed from Source/ThirdParty/woff2/src/woff2_enc.h.
(woff2::WOFF2Params::WOFF2Params):
* woff2/include/woff2/output.h: Renamed from Source/ThirdParty/woff2/src/woff2_out.h.
(woff2::WOFF2Out::~WOFF2Out):
(woff2::WOFF2StringOut::MaxSize):
* woff2/src/buffer.h:
* woff2/src/convert_woff2ttf_*.cc:
* woff2/src/file.h:
* woff2/src/font.cc:
* woff2/src/font.h:
* woff2/src/glyph.cc:
* woff2/src/glyph.h:
* woff2/src/normalize.cc:
* woff2/src/normalize.h:
* woff2/src/port.h:
* woff2/src/round.h:
* woff2/src/store_bytes.h:
* woff2/src/table_tags.cc:
* woff2/src/table_tags.h:
* woff2/src/transform.cc:
* woff2/src/transform.h:
* woff2/src/variable_length.cc:
* woff2/src/variable_length.h:
* woff2/src/woff2_common.cc:
* woff2/src/woff2_common.h:
* woff2/src/woff2_compress.cc:
* woff2/src/woff2_dec.cc:
* woff2/src/woff2_decompress.cc:
* woff2/src/woff2_enc.cc:
* woff2/src/woff2_info.cc:
* woff2/src/woff2_out.cc:
* woff2/update.sh: Also consider directory for public headers.

2017-10-03 Frederic Wang <fwang@igalia.com>

Remove Brotli from Source/ThirdParty
@@ -1,6 +1,7 @@
set(WOFF2_DIR "${THIRDPARTY_DIR}/woff2")

set(WOFF2_INCLUDE_DIRECTORIES
"${WOFF2_DIR}/include"
"${WOFF2_DIR}/src"
)

@@ -11,4 +11,4 @@ The in-tree copy is updated by running
sh update.sh
from within the modules/woff2 directory.

Current version: [commit aa283a500aeb655834d77f3cf9cf1b093b0b4389].
Current version: [commit 22c256bc457777744ba14b7325a6e8e0e7dec91c].
@@ -1,25 +1,17 @@
// Copyright 2014 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Library for converting WOFF2 format font files to their TTF versions.
/* Copyright 2014 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Library for converting WOFF2 format font files to their TTF versions. */

#ifndef WOFF2_WOFF2_DEC_H_
#define WOFF2_WOFF2_DEC_H_

#include <stddef.h>
#include <inttypes.h>
#include "./woff2_out.h"
#include <woff2/output.h>

namespace woff2 {

@@ -1,18 +1,10 @@
// Copyright 2014 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Library for converting WOFF2 format font files to their TTF versions.
/* Copyright 2014 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Library for converting WOFF2 format font files to their TTF versions. */

#ifndef WOFF2_WOFF2_ENC_H_
#define WOFF2_WOFF2_ENC_H_
@@ -21,24 +13,21 @@
#include <inttypes.h>
#include <string>

using std::string;


namespace woff2 {

struct WOFF2Params {
WOFF2Params() : extended_metadata(""), brotli_quality(11),
allow_transforms(true) {}

string extended_metadata;
std::string extended_metadata;
int brotli_quality;
bool allow_transforms;
};

// Returns an upper bound on the size of the compressed file.
size_t MaxWOFF2CompressedSize(const uint8_t* data, size_t length);
size_t MaxWOFF2CompressedSize(const uint8_t* data, size_t length,
const string& extended_metadata);
const std::string& extended_metadata);

// Compresses the font into the target buffer. *result_length should be at least
// the value returned by MaxWOFF2CompressedSize(), upon return, it is set to the
@@ -1,34 +1,10 @@
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Output buffer for WOFF2 decompression.

// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Output buffer for WOFF2 decompression.
/* Copyright 2016 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Output buffer for WOFF2 decompression. */

#ifndef WOFF2_WOFF2_OUT_H_
#define WOFF2_WOFF2_OUT_H_
@@ -37,16 +13,12 @@
#include <cstring>
#include <memory>
#include <string>
#include "./port.h"

namespace woff2 {

// Suggested max size for output.
const size_t kDefaultMaxSize = 30 * 1024 * 1024;

using std::string;


/**
* Output interface for the woff2 decoding.
*
@@ -79,15 +51,15 @@ class WOFF2StringOut : public WOFF2Out {
// Create a writer that writes its data to buf.
// buf->size() will grow to at most max_size
// buf may be sized (e.g. using EstimateWOFF2FinalSize) or empty.
explicit WOFF2StringOut(string* buf);
explicit WOFF2StringOut(std::string* buf);

bool Write(const void *buf, size_t n) override;
bool Write(const void *buf, size_t offset, size_t n) override;
size_t Size() override { return offset_; }
size_t MaxSize() { return max_size_; }
void SetMaxSize(size_t max_size);
private:
string* buf_;
std::string* buf_;
size_t max_size_;
size_t offset_;
};
@@ -1,19 +1,11 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// The parts of ots.h & opentype-sanitiser.h that we need, taken from the
// https://code.google.com/p/ots/ project.
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* The parts of ots.h & opentype-sanitiser.h that we need, taken from the
https://code.google.com/p/ots/ project. */

#ifndef WOFF2_BUFFER_H_
#define WOFF2_BUFFER_H_
@@ -1,7 +1,7 @@
#include <stddef.h>
#include <stdint.h>

#include "woff2_dec.h"
#include <woff2/decode.h>

// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
@@ -1,5 +1,5 @@
#include <string>
#include "woff2_dec.h"
#include <woff2/decode.h>

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t data_size) {
// Decode using newer entry pattern.
@@ -1,18 +1,10 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// File IO helpers.
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* File IO helpers. */

#ifndef WOFF2_FILE_H_
#define WOFF2_FILE_H_
@@ -1,18 +1,10 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Font management utilities
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Font management utilities */

#include "./font.h"

@@ -1,19 +1,11 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Data model for a font file in sfnt format, reading and writing functions and
// accessors for the glyph data.
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Data model for a font file in sfnt format, reading and writing functions and
accessors for the glyph data. */

#ifndef WOFF2_FONT_H_
#define WOFF2_FONT_H_
@@ -1,18 +1,10 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Glyph manipulation
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Glyph manipulation */

#include "./glyph.h"

0 comments on commit e8faeff

Please sign in to comment.