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

Side by Side Diff: chrome/renderer/pepper/pepper_flash_renderer_host.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/pepper/pepper_flash_renderer_host.h" 5 #include "chrome/renderer/pepper/pepper_flash_renderer_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (params.glyph_indices.size() != params.glyph_advances.size() || 203 if (params.glyph_indices.size() != params.glyph_advances.size() ||
204 params.glyph_indices.empty()) 204 params.glyph_indices.empty())
205 return PP_ERROR_FAILED; 205 return PP_ERROR_FAILED;
206 206
207 int style = SkTypeface::kNormal; 207 int style = SkTypeface::kNormal;
208 if (static_cast<PP_BrowserFont_Trusted_Weight>(params.font_desc.weight) >= 208 if (static_cast<PP_BrowserFont_Trusted_Weight>(params.font_desc.weight) >=
209 PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD) 209 PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD)
210 style |= SkTypeface::kBold; 210 style |= SkTypeface::kBold;
211 if (params.font_desc.italic) 211 if (params.font_desc.italic)
212 style |= SkTypeface::kItalic; 212 style |= SkTypeface::kItalic;
213 sk_sp<SkTypeface> typeface(SkTypeface::CreateFromName( 213 sk_sp<SkTypeface> typeface(SkTypeface::MakeFromName(
214 params.font_desc.face.c_str(), static_cast<SkTypeface::Style>(style))); 214 params.font_desc.face.c_str(), SkFontStyle::FromOldStyle(style)));
215 if (!typeface) 215 if (!typeface)
216 return PP_ERROR_FAILED; 216 return PP_ERROR_FAILED;
217 217
218 EnterResourceNoLock<PPB_ImageData_API> enter( 218 EnterResourceNoLock<PPB_ImageData_API> enter(
219 params.image_data.host_resource(), true); 219 params.image_data.host_resource(), true);
220 if (enter.failed()) 220 if (enter.failed())
221 return PP_ERROR_FAILED; 221 return PP_ERROR_FAILED;
222 222
223 PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(enter.object()); 223 PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(enter.object());
224 SkCanvas* canvas = image->GetCanvas(); 224 SkCanvas* canvas = image->GetCanvas();
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) 370 rect.point.x, rect.point.y, rect.size.width, rect.size.height)))
371 return PP_OK; 371 return PP_OK;
372 return PP_ERROR_FAILED; 372 return PP_ERROR_FAILED;
373 } 373 }
374 374
375 int32_t PepperFlashRendererHost::OnInvokePrinting( 375 int32_t PepperFlashRendererHost::OnInvokePrinting(
376 ppapi::host::HostMessageContext* host_context) { 376 ppapi::host::HostMessageContext* host_context) {
377 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance()); 377 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance());
378 return PP_OK; 378 return PP_OK;
379 } 379 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/network_dropdown.cc ('k') | components/favicon/core/fallback_icon_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698