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

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

Issue 1877673002: Move legacyCreateTypeface to SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DEPS change now that Skia change has landed. 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
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « content/browser/renderer_host/sandbox_ipc_linux.cc ('k') | content/common/font_config_ipc_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698