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

Side by Side Diff: webkit/plugins/ppapi/ppb_flash_impl_linux.cc

Issue 7621054: Don't use a scoped_refptr for StringVar::FromPPVar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc ('k') | webkit/plugins/ppapi/ppb_font_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_flash_impl.h" 5 #include "webkit/plugins/ppapi/ppb_flash_impl.h"
6 6
7 #include "ppapi/c/pp_point.h" 7 #include "ppapi/c/pp_point.h"
8 #include "ppapi/c/pp_rect.h" 8 #include "ppapi/c/pp_rect.h"
9 #include "ppapi/c/dev/ppb_font_dev.h" 9 #include "ppapi/c/dev/ppb_font_dev.h"
10 #include "ppapi/shared_impl/var.h" 10 #include "ppapi/shared_impl/var.h"
(...skipping 28 matching lines...) Expand all
39 if (enter.failed()) 39 if (enter.failed())
40 return PP_FALSE; 40 return PP_FALSE;
41 PPB_ImageData_Impl* image_resource = 41 PPB_ImageData_Impl* image_resource =
42 static_cast<PPB_ImageData_Impl*>(enter.object()); 42 static_cast<PPB_ImageData_Impl*>(enter.object());
43 43
44 ImageDataAutoMapper mapper(image_resource); 44 ImageDataAutoMapper mapper(image_resource);
45 if (!mapper.is_valid()) 45 if (!mapper.is_valid())
46 return PP_FALSE; 46 return PP_FALSE;
47 47
48 // Set up the typeface. 48 // Set up the typeface.
49 scoped_refptr<StringVar> face_name(StringVar::FromPPVar(font_desc->face)); 49 StringVar* face_name = StringVar::FromPPVar(font_desc->face);
50 if (!face_name) 50 if (!face_name)
51 return PP_FALSE; 51 return PP_FALSE;
52 int style = SkTypeface::kNormal; 52 int style = SkTypeface::kNormal;
53 if (font_desc->weight >= PP_FONTWEIGHT_BOLD) 53 if (font_desc->weight >= PP_FONTWEIGHT_BOLD)
54 style |= SkTypeface::kBold; 54 style |= SkTypeface::kBold;
55 if (font_desc->italic) 55 if (font_desc->italic)
56 style |= SkTypeface::kItalic; 56 style |= SkTypeface::kItalic;
57 SkTypeface* typeface = 57 SkTypeface* typeface =
58 SkTypeface::CreateFromName(face_name->value().c_str(), 58 SkTypeface::CreateFromName(face_name->value().c_str(),
59 static_cast<SkTypeface::Style>(style)); 59 static_cast<SkTypeface::Style>(style));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint); 112 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint);
113 113
114 canvas->restore(); 114 canvas->restore();
115 return PP_TRUE; 115 return PP_TRUE;
116 } 116 }
117 117
118 } // namespace ppapi 118 } // namespace ppapi
119 } // namespace webkit 119 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc ('k') | webkit/plugins/ppapi/ppb_font_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698