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

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: Mac fixes 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 !iter.ReadBool(&italic) || 297 !iter.ReadBool(&italic) ||
298 !iter.ReadUInt16(&pixel_size)) { 298 !iter.ReadUInt16(&pixel_size)) {
299 return; 299 return;
300 } 300 }
301 301
302 EnsureWebKitInitialized(); 302 EnsureWebKitInitialized();
303 303
304 gfx::FontRenderParamsQuery query; 304 gfx::FontRenderParamsQuery query;
305 query.families.push_back(family); 305 query.families.push_back(family);
306 query.pixel_size = pixel_size; 306 query.pixel_size = pixel_size;
307 query.style = gfx::Font::NORMAL | 307 query.style = italic ? gfx::Font::ITALIC : 0;
308 (bold ? gfx::Font::BOLD : 0) | (italic ? gfx::Font::ITALIC : 0); 308 query.weight = bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL;
309 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL); 309 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL);
310 310
311 // These are passed as ints since they're interpreted as tri-state chars in 311 // These are passed as ints since they're interpreted as tri-state chars in
312 // Blink. 312 // Blink.
313 base::Pickle reply; 313 base::Pickle reply;
314 reply.WriteInt(params.use_bitmaps); 314 reply.WriteInt(params.use_bitmaps);
315 reply.WriteInt(params.autohinter); 315 reply.WriteInt(params.autohinter);
316 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE); 316 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE);
317 reply.WriteInt(ConvertHinting(params.hinting)); 317 reply.WriteInt(ConvertHinting(params.hinting));
318 reply.WriteInt(params.antialiasing); 318 reply.WriteInt(params.antialiasing);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 } 443 }
444 444
445 void SandboxIPCHandler::EnsureWebKitInitialized() { 445 void SandboxIPCHandler::EnsureWebKitInitialized() {
446 if (blink_platform_impl_) 446 if (blink_platform_impl_)
447 return; 447 return;
448 blink_platform_impl_.reset(new BlinkPlatformImpl); 448 blink_platform_impl_.reset(new BlinkPlatformImpl);
449 blink::Platform::initialize(blink_platform_impl_.get()); 449 blink::Platform::initialize(blink_platform_impl_.get());
450 } 450 }
451 451
452 } // namespace content 452 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698