| 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 "content/child/browser_font_resource_trusted.h" | 5 #include "content/child/browser_font_resource_trusted.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/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/proxy/connection.h" | 10 #include "ppapi/proxy/connection.h" |
| 11 #include "ppapi/shared_impl/ppapi_preferences.h" | 11 #include "ppapi/shared_impl/ppapi_preferences.h" |
| 12 #include "ppapi/shared_impl/var.h" | 12 #include "ppapi/shared_impl/var.h" |
| 13 #include "ppapi/thunk/enter.h" | 13 #include "ppapi/thunk/enter.h" |
| 14 #include "ppapi/thunk/ppb_image_data_api.h" | 14 #include "ppapi/thunk/ppb_image_data_api.h" |
| 15 #include "ppapi/thunk/thunk.h" | 15 #include "ppapi/thunk/thunk.h" |
| 16 #include "skia/ext/platform_canvas.h" | 16 #include "skia/ext/platform_canvas.h" |
| 17 #include "third_party/WebKit/public/platform/WebCanvas.h" | 17 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 18 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 18 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 19 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 19 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 20 #include "third_party/WebKit/public/platform/WebRect.h" | 20 #include "third_party/WebKit/public/platform/WebRect.h" |
| 21 #include "third_party/WebKit/public/web/WebFont.h" | 21 #include "third_party/WebKit/public/web/WebFont.h" |
| 22 #include "third_party/WebKit/public/web/WebFontDescription.h" | 22 #include "third_party/WebKit/public/web/WebFontDescription.h" |
| 23 #include "third_party/WebKit/public/web/WebTextRun.h" | 23 #include "third_party/WebKit/public/web/WebTextRun.h" |
| 24 #include "third_party/icu/source/common/unicode/ubidi.h" | 24 #include "third_party/icu/source/common/unicode/ubidi.h" |
| 25 #include "third_party/skia/include/core/SkRect.h" | 25 #include "third_party/skia/include/core/SkRect.h" |
| 26 | 26 |
| 27 using ppapi::StringVar; | 27 using ppapi::StringVar; |
| 28 using ppapi::thunk::EnterResourceNoLock; | 28 using ppapi::thunk::EnterResourceNoLock; |
| 29 using ppapi::thunk::PPB_ImageData_API; | 29 using ppapi::thunk::PPB_ImageData_API; |
| 30 using WebKit::WebFloatPoint; | 30 using blink::WebFloatPoint; |
| 31 using WebKit::WebFloatRect; | 31 using blink::WebFloatRect; |
| 32 using WebKit::WebFont; | 32 using blink::WebFont; |
| 33 using WebKit::WebFontDescription; | 33 using blink::WebFontDescription; |
| 34 using WebKit::WebRect; | 34 using blink::WebRect; |
| 35 using WebKit::WebTextRun; | 35 using blink::WebTextRun; |
| 36 using WebKit::WebCanvas; | 36 using blink::WebCanvas; |
| 37 | 37 |
| 38 namespace content { | 38 namespace content { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 // Same as WebPreferences::kCommonScript. I'd use that directly here, but get an | 42 // Same as WebPreferences::kCommonScript. I'd use that directly here, but get an |
| 43 // undefined reference linker error. | 43 // undefined reference linker error. |
| 44 const char kCommonScript[] = "Zyyy"; | 44 const char kCommonScript[] = "Zyyy"; |
| 45 | 45 |
| 46 string16 GetFontFromMap( | 46 string16 GetFontFromMap( |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 419 |
| 420 // Advance to the next run. Note that we avoid doing this for the last run | 420 // Advance to the next run. Note that we avoid doing this for the last run |
| 421 // since it's unnecessary, measuring text is slow, and most of the time | 421 // since it's unnecessary, measuring text is slow, and most of the time |
| 422 // there will be only one run anyway. | 422 // there will be only one run anyway. |
| 423 if (i != runs.num_runs() - 1) | 423 if (i != runs.num_runs() - 1) |
| 424 web_position.x += font_->calculateWidth(run); | 424 web_position.x += font_->calculateWidth(run); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 } // namespace content | 428 } // namespace content |
| OLD | NEW |