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

Side by Side Diff: content/browser/renderer_host/sandbox_ipc_linux.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Alexei's issues 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/renderer_host/sandbox_ipc_linux.h" 5 #include "content/browser/renderer_host/sandbox_ipc_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 !iter.ReadBool(&italic) || 296 !iter.ReadBool(&italic) ||
297 !iter.ReadUInt16(&pixel_size)) { 297 !iter.ReadUInt16(&pixel_size)) {
298 return; 298 return;
299 } 299 }
300 300
301 EnsureWebKitInitialized(); 301 EnsureWebKitInitialized();
302 302
303 gfx::FontRenderParamsQuery query; 303 gfx::FontRenderParamsQuery query;
304 query.families.push_back(family); 304 query.families.push_back(family);
305 query.pixel_size = pixel_size; 305 query.pixel_size = pixel_size;
306 query.style = gfx::Font::NORMAL | 306 query.style = italic ? gfx::Font::ITALIC : 0;
307 (bold ? gfx::Font::BOLD : 0) | (italic ? gfx::Font::ITALIC : 0); 307 query.weight = bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL;
308 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL); 308 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL);
309 309
310 // These are passed as ints since they're interpreted as tri-state chars in 310 // These are passed as ints since they're interpreted as tri-state chars in
311 // Blink. 311 // Blink.
312 base::Pickle reply; 312 base::Pickle reply;
313 reply.WriteInt(params.use_bitmaps); 313 reply.WriteInt(params.use_bitmaps);
314 reply.WriteInt(params.autohinter); 314 reply.WriteInt(params.autohinter);
315 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE); 315 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE);
316 reply.WriteInt(ConvertHinting(params.hinting)); 316 reply.WriteInt(ConvertHinting(params.hinting));
317 reply.WriteInt(params.antialiasing); 317 reply.WriteInt(params.antialiasing);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } 442 }
443 443
444 void SandboxIPCHandler::EnsureWebKitInitialized() { 444 void SandboxIPCHandler::EnsureWebKitInitialized() {
445 if (blink_platform_impl_) 445 if (blink_platform_impl_)
446 return; 446 return;
447 blink_platform_impl_.reset(new BlinkPlatformImpl); 447 blink_platform_impl_.reset(new BlinkPlatformImpl);
448 blink::Platform::initialize(blink_platform_impl_.get()); 448 blink::Platform::initialize(blink_platform_impl_.get());
449 } 449 }
450 450
451 } // namespace content 451 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698