Skip to content

Commit

Permalink
Merge r222960 - Update Source/ThirdParty/woff2 to 22c256bc457777744ba…
Browse files Browse the repository at this point in the history
…14b7325a6e8e0e7dec91c

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):
  • Loading branch information
fred-wang authored and carlosgcampos committed Oct 17, 2017
1 parent da333d1 commit a53cb21
Show file tree
Hide file tree
Showing 37 changed files with 289 additions and 474 deletions.
43 changes: 43 additions & 0 deletions Source/ThirdParty/ChangeLog
@@ -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-05 Frederic Wang <fwang@igalia.com>

Upgrade Brotli to version 1.0.1 and WOFF2 to latest upstream
Expand Down
1 change: 1 addition & 0 deletions Source/ThirdParty/woff2/CMakeLists.txt
@@ -1,6 +1,7 @@
set(WOFF2_DIR "${THIRDPARTY_DIR}/woff2")

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

Expand Down
2 changes: 1 addition & 1 deletion Source/ThirdParty/woff2/README.webkit
Expand Up @@ -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 {

Expand Down
@@ -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_
Expand All @@ -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
Expand Down
@@ -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_
Expand All @@ -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.
*
Expand Down Expand Up @@ -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_;
};
Expand Down
24 changes: 8 additions & 16 deletions Source/ThirdParty/woff2/src/buffer.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.
//
// 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_
Expand Down
2 changes: 1 addition & 1 deletion Source/ThirdParty/woff2/src/convert_woff2ttf_fuzzer.cc
@@ -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) {
Expand Down
@@ -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.
Expand Down
22 changes: 7 additions & 15 deletions Source/ThirdParty/woff2/src/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.
//
// 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_
Expand Down
22 changes: 7 additions & 15 deletions Source/ThirdParty/woff2/src/font.cc
@@ -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"

Expand Down
24 changes: 8 additions & 16 deletions Source/ThirdParty/woff2/src/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_
Expand Down
22 changes: 7 additions & 15 deletions Source/ThirdParty/woff2/src/glyph.cc
@@ -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"

Expand Down

0 comments on commit a53cb21

Please sign in to comment.