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 19 matching lines...) Expand all Loading... |
30 const char* familyName, | 30 const char* familyName, |
31 SkFontTableTag tag, | 31 SkFontTableTag tag, |
32 const char* data, | 32 const char* data, |
33 size_t dataLength) | 33 size_t dataLength) |
34 : SkTypeface(style, 0), | 34 : SkTypeface(style, 0), |
35 familyName_(familyName), | 35 familyName_(familyName), |
36 tag_(tag), | 36 tag_(tag), |
37 data_(data, data + dataLength) {} | 37 data_(data, data + dataLength) {} |
38 | 38 |
39 protected: | 39 protected: |
40 #ifdef SK_SUPPORT_NEW_ONCREATESCALERCONTEXT | |
41 SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&, | 40 SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&, |
42 const SkDescriptor*) const override { | 41 const SkDescriptor*) const override { |
43 #else | |
44 SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override { | |
45 #endif | |
46 ADD_FAILURE(); | 42 ADD_FAILURE(); |
47 return nullptr; | 43 return nullptr; |
48 } | 44 } |
49 void onFilterRec(SkScalerContextRec*) const override { ADD_FAILURE(); } | 45 void onFilterRec(SkScalerContextRec*) const override { ADD_FAILURE(); } |
50 SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( | 46 SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( |
51 PerGlyphInfo, | 47 PerGlyphInfo, |
52 const uint32_t* glyphIDs, | 48 const uint32_t* glyphIDs, |
53 uint32_t glyphIDsCount) const override { | 49 uint32_t glyphIDsCount) const override { |
54 ADD_FAILURE(); | 50 ADD_FAILURE(); |
55 return nullptr; | 51 return nullptr; |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); | 427 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); |
432 std::vector<char> data(data_size); | 428 std::vector<char> data(data_size); |
433 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); | 429 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); |
434 EXPECT_EQ(size, data_size); | 430 EXPECT_EQ(size, data_size); |
435 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); | 431 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); |
436 EXPECT_TRUE(DeleteObject(font)); | 432 EXPECT_TRUE(DeleteObject(font)); |
437 EXPECT_TRUE(DeleteDC(hdc)); | 433 EXPECT_TRUE(DeleteDC(hdc)); |
438 } | 434 } |
439 | 435 |
440 } // namespace content | 436 } // namespace content |
OLD | NEW |