OLD | NEW |
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/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <objidl.h> | 8 #include <objidl.h> |
9 #include <mlang.h> | 9 #include <mlang.h> |
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 DumpLeakedObject(__FILE__, __LINE__, "WebFrame", count); | 263 DumpLeakedObject(__FILE__, __LINE__, "WebFrame", count); |
264 #endif | 264 #endif |
265 } | 265 } |
266 | 266 |
267 bool DecodeImage(const std::string& image_data, SkBitmap* image) { | 267 bool DecodeImage(const std::string& image_data, SkBitmap* image) { |
268 WebData web_data(image_data.data(), image_data.length()); | 268 WebData web_data(image_data.data(), image_data.length()); |
269 WebImage web_image(WebImage::fromData(web_data, WebSize())); | 269 WebImage web_image(WebImage::fromData(web_data, WebSize())); |
270 if (web_image.isNull()) | 270 if (web_image.isNull()) |
271 return false; | 271 return false; |
272 | 272 |
273 #if defined(OS_MACOSX) | 273 #if defined(OS_MACOSX) && !defined(USE_SKIA) |
274 *image = gfx::CGImageToSkBitmap(web_image.getCGImageRef()); | 274 *image = gfx::CGImageToSkBitmap(web_image.getCGImageRef()); |
275 #else | 275 #else |
276 *image = web_image.getSkBitmap(); | 276 *image = web_image.getSkBitmap(); |
277 #endif | 277 #endif |
278 return true; | 278 return true; |
279 } | 279 } |
280 | 280 |
281 // NOTE: This pair of conversion functions are here instead of in glue_util.cc | 281 // NOTE: This pair of conversion functions are here instead of in glue_util.cc |
282 // since that file will eventually die. This pair of functions will need to | 282 // since that file will eventually die. This pair of functions will need to |
283 // remain as the concept of a file-path specific character encoding string type | 283 // remain as the concept of a file-path specific character encoding string type |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 NOTIMPLEMENTED(); | 412 NOTIMPLEMENTED(); |
413 return NULL; | 413 return NULL; |
414 #endif | 414 #endif |
415 } | 415 } |
416 | 416 |
417 int GetGlyphPageCount() { | 417 int GetGlyphPageCount() { |
418 return WebGlyphCache::pageCount(); | 418 return WebGlyphCache::pageCount(); |
419 } | 419 } |
420 | 420 |
421 } // namespace webkit_glue | 421 } // namespace webkit_glue |
OLD | NEW |