| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "public/platform/Platform.h" | 45 #include "public/platform/Platform.h" |
| 46 #include "public/platform/WebData.h" | 46 #include "public/platform/WebData.h" |
| 47 #include "third_party/skia/include/core/SkImage.h" | 47 #include "third_party/skia/include/core/SkImage.h" |
| 48 | 48 |
| 49 #include <math.h> | 49 #include <math.h> |
| 50 #include <tuple> | 50 #include <tuple> |
| 51 | 51 |
| 52 namespace blink { | 52 namespace blink { |
| 53 | 53 |
| 54 Image::Image(ImageObserver* observer) | 54 Image::Image(ImageObserver* observer) |
| 55 : image_observer_(observer), image_observer_disabled_(false) {} | 55 : image_observer_disabled_(false), image_observer_(observer) {} |
| 56 | 56 |
| 57 Image::~Image() {} | 57 Image::~Image() {} |
| 58 | 58 |
| 59 Image* Image::NullImage() { | 59 Image* Image::NullImage() { |
| 60 DCHECK(IsMainThread()); | 60 DCHECK(IsMainThread()); |
| 61 DEFINE_STATIC_REF(Image, null_image, (BitmapImage::Create())); | 61 DEFINE_STATIC_REF(Image, null_image, (BitmapImage::Create())); |
| 62 return null_image; | 62 return null_image; |
| 63 } | 63 } |
| 64 | 64 |
| 65 PassRefPtr<Image> Image::LoadPlatformResource(const char* name) { | 65 PassRefPtr<Image> Image::LoadPlatformResource(const char* name) { |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 FloatRect subset = dest; | 390 FloatRect subset = dest; |
| 391 subset.SetX((dest.X() - tile.X()) / scale.Width()); | 391 subset.SetX((dest.X() - tile.X()) / scale.Width()); |
| 392 subset.SetY((dest.Y() - tile.Y()) / scale.Height()); | 392 subset.SetY((dest.Y() - tile.Y()) / scale.Height()); |
| 393 subset.SetWidth(dest.Width() / scale.Width()); | 393 subset.SetWidth(dest.Width() / scale.Width()); |
| 394 subset.SetHeight(dest.Height() / scale.Height()); | 394 subset.SetHeight(dest.Height() / scale.Height()); |
| 395 | 395 |
| 396 return subset; | 396 return subset; |
| 397 } | 397 } |
| 398 | 398 |
| 399 } // namespace blink | 399 } // namespace blink |
| OLD | NEW |