Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: content/child/font_warmup_win_unittest.cc

Issue 1878913002: add SK_SUPPORT_NEW_ONCREATESCALERCONTEXT for upcoming skia change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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&,
42 const SkDescriptor*) const override {
43 #else
40 SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override { 44 SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override {
45 #endif
41 ADD_FAILURE(); 46 ADD_FAILURE();
42 return nullptr; 47 return nullptr;
43 } 48 }
44 void onFilterRec(SkScalerContextRec*) const override { ADD_FAILURE(); } 49 void onFilterRec(SkScalerContextRec*) const override { ADD_FAILURE(); }
45 SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( 50 SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
46 PerGlyphInfo, 51 PerGlyphInfo,
47 const uint32_t* glyphIDs, 52 const uint32_t* glyphIDs,
48 uint32_t glyphIDsCount) const override { 53 uint32_t glyphIDsCount) const override {
49 ADD_FAILURE(); 54 ADD_FAILURE();
50 return nullptr; 55 return nullptr;
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData)); 431 DWORD data_size = static_cast<DWORD>(strlen(kTestFontData));
427 std::vector<char> data(data_size); 432 std::vector<char> data(data_size);
428 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size()); 433 DWORD size = GetFontData(hdc, kTestFontTableTag, 0, &data[0], data.size());
429 EXPECT_EQ(size, data_size); 434 EXPECT_EQ(size, data_size);
430 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0); 435 EXPECT_EQ(memcmp(&data[0], kTestFontData, data.size()), 0);
431 EXPECT_TRUE(DeleteObject(font)); 436 EXPECT_TRUE(DeleteObject(font));
432 EXPECT_TRUE(DeleteDC(hdc)); 437 EXPECT_TRUE(DeleteDC(hdc));
433 } 438 }
434 439
435 } // namespace content 440 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698