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/webcursor.h" | 5 #include "webkit/glue/webcursor.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 #include <Carbon/Carbon.h> | 8 #include <Carbon/Carbon.h> |
9 | 9 |
10 #include "app/mac/nsimage_cache.h" | 10 #include "app/mac/nsimage_cache.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 cursor_info.hotSpot = WebKit::WebPoint(hot_spot.x, hot_spot.y); | 327 cursor_info.hotSpot = WebKit::WebPoint(hot_spot.x, hot_spot.y); |
328 cursor_info.customImage = cg_image; | 328 cursor_info.customImage = cg_image; |
329 } else { | 329 } else { |
330 cursor_info.type = WebCursorInfo::TypePointer; | 330 cursor_info.type = WebCursorInfo::TypePointer; |
331 } | 331 } |
332 } | 332 } |
333 | 333 |
334 InitFromCursorInfo(cursor_info); | 334 InitFromCursorInfo(cursor_info); |
335 } | 335 } |
336 | 336 |
| 337 #if !WEBKIT_USING_SKIA |
337 void WebCursor::SetCustomData(const WebImage& image) { | 338 void WebCursor::SetCustomData(const WebImage& image) { |
338 if (image.isNull()) | 339 if (image.isNull()) |
339 return; | 340 return; |
340 | 341 |
341 base::mac::ScopedCFTypeRef<CGColorSpaceRef> cg_color( | 342 base::mac::ScopedCFTypeRef<CGColorSpaceRef> cg_color( |
342 CGColorSpaceCreateDeviceRGB()); | 343 CGColorSpaceCreateDeviceRGB()); |
343 | 344 |
344 const WebSize& image_dimensions = image.size(); | 345 const WebSize& image_dimensions = image.size(); |
345 int image_width = image_dimensions.width; | 346 int image_width = image_dimensions.width; |
346 int image_height = image_dimensions.height; | 347 int image_height = image_dimensions.height; |
(...skipping 20 matching lines...) Expand all Loading... |
367 } | 368 } |
368 | 369 |
369 void WebCursor::ImageFromCustomData(WebImage* image) const { | 370 void WebCursor::ImageFromCustomData(WebImage* image) const { |
370 if (custom_data_.empty()) | 371 if (custom_data_.empty()) |
371 return; | 372 return; |
372 | 373 |
373 base::mac::ScopedCFTypeRef<CGImageRef> cg_image( | 374 base::mac::ScopedCFTypeRef<CGImageRef> cg_image( |
374 CreateCGImageFromCustomData(custom_data_, custom_size_)); | 375 CreateCGImageFromCustomData(custom_data_, custom_size_)); |
375 *image = cg_image.get(); | 376 *image = cg_image.get(); |
376 } | 377 } |
| 378 #endif |
377 | 379 |
378 void WebCursor::InitPlatformData() { | 380 void WebCursor::InitPlatformData() { |
379 return; | 381 return; |
380 } | 382 } |
381 | 383 |
382 bool WebCursor::SerializePlatformData(Pickle* pickle) const { | 384 bool WebCursor::SerializePlatformData(Pickle* pickle) const { |
383 return true; | 385 return true; |
384 } | 386 } |
385 | 387 |
386 bool WebCursor::DeserializePlatformData(const Pickle* pickle, void** iter) { | 388 bool WebCursor::DeserializePlatformData(const Pickle* pickle, void** iter) { |
387 return true; | 389 return true; |
388 } | 390 } |
389 | 391 |
390 bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const { | 392 bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const { |
391 return true; | 393 return true; |
392 } | 394 } |
393 | 395 |
394 void WebCursor::CleanupPlatformData() { | 396 void WebCursor::CleanupPlatformData() { |
395 return; | 397 return; |
396 } | 398 } |
397 | 399 |
398 void WebCursor::CopyPlatformData(const WebCursor& other) { | 400 void WebCursor::CopyPlatformData(const WebCursor& other) { |
399 return; | 401 return; |
400 } | 402 } |
OLD | NEW |