| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "platform/graphics/StaticBitmapImage.h" | 5 #include "platform/graphics/StaticBitmapImage.h" |
| 6 | 6 |
| 7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
| 8 #include "platform/graphics/ImageObserver.h" | 8 #include "platform/graphics/ImageObserver.h" |
| 9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "third_party/skia/include/core/SkImage.h" | 10 #include "third_party/skia/include/core/SkImage.h" |
| 11 #include "third_party/skia/include/core/SkPaint.h" | 11 #include "third_party/skia/include/core/SkPaint.h" |
| 12 #include "third_party/skia/include/core/SkShader.h" | 12 #include "third_party/skia/include/core/SkShader.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 PassRefPtr<StaticBitmapImage> StaticBitmapImage::create(PassRefPtr<SkImage> imag
e) | 16 PassRefPtr<StaticBitmapImage> StaticBitmapImage::create(PassRefPtr<SkImage> imag
e, bool hasSingleSecurityOrigin) |
| 17 { | 17 { |
| 18 if (!image) | 18 if (!image) |
| 19 return nullptr; | 19 return nullptr; |
| 20 return adoptRef(new StaticBitmapImage(image)); | 20 return adoptRef(new StaticBitmapImage(image, hasSingleSecurityOrigin)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 StaticBitmapImage::StaticBitmapImage(PassRefPtr<SkImage> image) : m_image(image) | 23 StaticBitmapImage::StaticBitmapImage(PassRefPtr<SkImage> image, bool hasSingleSe
curityOrigin) |
| 24 : m_image(image) |
| 25 , m_isOriginClean(hasSingleSecurityOrigin) |
| 24 { | 26 { |
| 25 ASSERT(m_image); | 27 ASSERT(m_image); |
| 26 } | 28 } |
| 27 | 29 |
| 28 StaticBitmapImage::~StaticBitmapImage() { } | 30 StaticBitmapImage::~StaticBitmapImage() { } |
| 29 | 31 |
| 30 IntSize StaticBitmapImage::size() const | 32 IntSize StaticBitmapImage::size() const |
| 31 { | 33 { |
| 32 return IntSize(m_image->width(), m_image->height()); | 34 return IntSize(m_image->width(), m_image->height()); |
| 33 } | 35 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 58 if (ImageObserver* observer = imageObserver()) | 60 if (ImageObserver* observer = imageObserver()) |
| 59 observer->didDraw(this); | 61 observer->didDraw(this); |
| 60 } | 62 } |
| 61 | 63 |
| 62 PassRefPtr<SkImage> StaticBitmapImage::imageForCurrentFrame() | 64 PassRefPtr<SkImage> StaticBitmapImage::imageForCurrentFrame() |
| 63 { | 65 { |
| 64 return m_image; | 66 return m_image; |
| 65 } | 67 } |
| 66 | 68 |
| 67 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |