| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/child/font_warmup_win.h" | 5 #include "content/child/font_warmup_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 ADD_FAILURE(); | 193 ADD_FAILURE(); |
| 194 return nullptr; | 194 return nullptr; |
| 195 } | 195 } |
| 196 | 196 |
| 197 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override { | 197 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override { |
| 198 ADD_FAILURE(); | 198 ADD_FAILURE(); |
| 199 return nullptr; | 199 return nullptr; |
| 200 } | 200 } |
| 201 | 201 |
| 202 SkTypeface* onLegacyCreateTypeface(const char familyName[], | 202 SkTypeface* onLegacyCreateTypeface(const char familyName[], |
| 203 unsigned styleBits) const override { | 203 SkFontStyle style) const override { |
| 204 ADD_FAILURE(); | 204 ADD_FAILURE(); |
| 205 return nullptr; | 205 return nullptr; |
| 206 } | 206 } |
| 207 | 207 |
| 208 private: | 208 private: |
| 209 SkTypeface* createTypeface() const { | 209 SkTypeface* createTypeface() const { |
| 210 SkFontStyle style(400, 100, SkFontStyle::kUpright_Slant); | 210 SkFontStyle style(400, 100, SkFontStyle::kUpright_Slant); |
| 211 | 211 |
| 212 return new TestSkTypeface(style, kTestFontFamily, | 212 return new TestSkTypeface(style, kTestFontFamily, |
| 213 base::ByteSwap(kTestFontTableTag), kTestFontData, | 213 base::ByteSwap(kTestFontTableTag), kTestFontData, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); | 426 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); |
| 427 std::vector<char> data(data_size); | 427 std::vector<char> data(data_size); |
| 428 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); | 428 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); |
| 429 EXPECT_EQ(size, data_size); | 429 EXPECT_EQ(size, data_size); |
| 430 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); | 430 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); |
| 431 EXPECT_TRUE(DeleteObject(font)); | 431 EXPECT_TRUE(DeleteObject(font)); |
| 432 EXPECT_TRUE(DeleteDC(hdc)); | 432 EXPECT_TRUE(DeleteDC(hdc)); |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace content | 435 } // namespace content |
| OLD | NEW |