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

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: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 6 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (!iter.ReadString(&family) || 277 if (!iter.ReadString(&family) ||
278 !iter.ReadBool(&bold) || 278 !iter.ReadBool(&bold) ||
279 !iter.ReadBool(&italic) || 279 !iter.ReadBool(&italic) ||
280 !iter.ReadUInt16(&pixel_size)) { 280 !iter.ReadUInt16(&pixel_size)) {
281 return; 281 return;
282 } 282 }
283 283
284 gfx::FontRenderParamsQuery query; 284 gfx::FontRenderParamsQuery query;
285 query.families.push_back(family); 285 query.families.push_back(family);
286 query.pixel_size = pixel_size; 286 query.pixel_size = pixel_size;
287 query.style = gfx::Font::NORMAL | 287 query.style = italic ? gfx::Font::ITALIC : 0;
288 (bold ? gfx::Font::BOLD : 0) | (italic ? gfx::Font::ITALIC : 0); 288 query.weight = bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL;
289 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL); 289 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL);
290 290
291 // These are passed as ints since they're interpreted as tri-state chars in 291 // These are passed as ints since they're interpreted as tri-state chars in
292 // Blink. 292 // Blink.
293 base::Pickle reply; 293 base::Pickle reply;
294 reply.WriteInt(params.use_bitmaps); 294 reply.WriteInt(params.use_bitmaps);
295 reply.WriteInt(params.autohinter); 295 reply.WriteInt(params.autohinter);
296 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE); 296 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE);
297 reply.WriteInt(ConvertHinting(params.hinting)); 297 reply.WriteInt(ConvertHinting(params.hinting));
298 reply.WriteInt(params.antialiasing); 298 reply.WriteInt(params.antialiasing);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 416 }
417 417
418 SandboxIPCHandler::~SandboxIPCHandler() { 418 SandboxIPCHandler::~SandboxIPCHandler() {
419 if (IGNORE_EINTR(close(lifeline_fd_)) < 0) 419 if (IGNORE_EINTR(close(lifeline_fd_)) < 0)
420 PLOG(ERROR) << "close"; 420 PLOG(ERROR) << "close";
421 if (IGNORE_EINTR(close(browser_socket_)) < 0) 421 if (IGNORE_EINTR(close(browser_socket_)) < 0)
422 PLOG(ERROR) << "close"; 422 PLOG(ERROR) << "close";
423 } 423 }
424 424
425 } // namespace content 425 } // namespace content
OLDNEW
« no previous file with comments | « components/favicon/core/fallback_icon_service.cc ('k') | ui/app_list/views/search_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698