OLD | NEW |
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 "ppapi/shared_impl/private/ppb_browser_font_trusted_shared.h" | 5 #include "ppapi/shared_impl/private/ppb_browser_font_trusted_shared.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "ppapi/c/dev/ppb_font_dev.h" | 9 #include "ppapi/c/dev/ppb_font_dev.h" |
10 #include "ppapi/shared_impl/ppapi_preferences.h" | 10 #include "ppapi/shared_impl/ppapi_preferences.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // the current clip bounds. | 302 // the current clip bounds. |
303 SkRect skclip; | 303 SkRect skclip; |
304 destination->getClipBounds(&skclip); | 304 destination->getClipBounds(&skclip); |
305 web_clip = WebRect(skclip.fLeft, skclip.fTop, skclip.fRight - skclip.fLeft, | 305 web_clip = WebRect(skclip.fLeft, skclip.fTop, skclip.fRight - skclip.fLeft, |
306 skclip.fBottom - skclip.fTop); | 306 skclip.fBottom - skclip.fTop); |
307 } else { | 307 } else { |
308 web_clip = WebRect(clip->point.x, clip->point.y, | 308 web_clip = WebRect(clip->point.x, clip->point.y, |
309 clip->size.width, clip->size.height); | 309 clip->size.width, clip->size.height); |
310 } | 310 } |
311 | 311 |
312 #if WEBKIT_USING_SKIA | 312 font_->drawText(destination, run, web_position, color, web_clip, |
313 WebCanvas* canvas = destination; | |
314 #elif WEBKIT_USING_CG | |
315 WebCanvas* canvas = skia::GetBitmapContext(skia::GetTopDevice(*destination)); | |
316 #else | |
317 NOTIMPLEMENTED(); | |
318 return; | |
319 #endif | |
320 font_->drawText(canvas, run, web_position, color, web_clip, | |
321 PP_ToBool(image_data_is_opaque)); | 313 PP_ToBool(image_data_is_opaque)); |
322 } | 314 } |
323 | 315 |
324 } // namespace ppapi | 316 } // namespace ppapi |
325 | 317 |
OLD | NEW |