OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include <tuple> | 49 #include <tuple> |
50 | 50 |
51 namespace blink { | 51 namespace blink { |
52 | 52 |
53 Image::Image(ImageObserver* observer) | 53 Image::Image(ImageObserver* observer) |
54 : m_imageObserver(observer), m_imageObserverDisabled(false) {} | 54 : m_imageObserver(observer), m_imageObserverDisabled(false) {} |
55 | 55 |
56 Image::~Image() {} | 56 Image::~Image() {} |
57 | 57 |
58 Image* Image::nullImage() { | 58 Image* Image::nullImage() { |
59 ASSERT(isMainThread()); | 59 DCHECK(isMainThread()); |
60 DEFINE_STATIC_REF(Image, nullImage, (BitmapImage::create())); | 60 DEFINE_STATIC_REF(Image, nullImage, (BitmapImage::create())); |
61 return nullImage; | 61 return nullImage; |
62 } | 62 } |
63 | 63 |
64 PassRefPtr<Image> Image::loadPlatformResource(const char* name) { | 64 PassRefPtr<Image> Image::loadPlatformResource(const char* name) { |
65 const WebData& resource = Platform::current()->loadResource(name); | 65 const WebData& resource = Platform::current()->loadResource(name); |
66 if (resource.isEmpty()) | 66 if (resource.isEmpty()) |
67 return Image::nullImage(); | 67 return Image::nullImage(); |
68 | 68 |
69 RefPtr<Image> image = BitmapImage::create(); | 69 RefPtr<Image> image = BitmapImage::create(); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 FloatRect subset = dest; | 378 FloatRect subset = dest; |
379 subset.setX((dest.x() - tile.x()) / scale.width()); | 379 subset.setX((dest.x() - tile.x()) / scale.width()); |
380 subset.setY((dest.y() - tile.y()) / scale.height()); | 380 subset.setY((dest.y() - tile.y()) / scale.height()); |
381 subset.setWidth(dest.width() / scale.width()); | 381 subset.setWidth(dest.width() / scale.width()); |
382 subset.setHeight(dest.height() / scale.height()); | 382 subset.setHeight(dest.height() / scale.height()); |
383 | 383 |
384 return subset; | 384 return subset; |
385 } | 385 } |
386 | 386 |
387 } // namespace blink | 387 } // namespace blink |
OLD | NEW |