OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "config.h" | 5 #include "config.h" |
6 #include "core/frame/ImageBitmap.h" | 6 #include "core/frame/ImageBitmap.h" |
7 | 7 |
8 #include "core/html/HTMLCanvasElement.h" | 8 #include "core/html/HTMLCanvasElement.h" |
9 #include "core/html/HTMLVideoElement.h" | 9 #include "core/html/HTMLVideoElement.h" |
10 #include "core/html/ImageData.h" | 10 #include "core/html/ImageData.h" |
11 #include "core/html/canvas/CanvasRenderingContext.h" | 11 #include "core/html/canvas/CanvasRenderingContext.h" |
12 #include "core/platform/graphics/BitmapImage.h" | 12 #include "platform/graphics/BitmapImage.h" |
13 #include "core/platform/graphics/GraphicsContext.h" | 13 #include "platform/graphics/GraphicsContext.h" |
14 #include "core/platform/graphics/ImageBuffer.h" | 14 #include "platform/graphics/ImageBuffer.h" |
15 #include "wtf/RefPtr.h" | 15 #include "wtf/RefPtr.h" |
16 | 16 |
17 using namespace std; | 17 using namespace std; |
18 | 18 |
19 namespace WebCore { | 19 namespace WebCore { |
20 | 20 |
21 static inline IntRect normalizeRect(const IntRect& rect) | 21 static inline IntRect normalizeRect(const IntRect& rect) |
22 { | 22 { |
23 return IntRect(min(rect.x(), rect.maxX()), | 23 return IntRect(min(rect.x(), rect.maxX()), |
24 min(rect.y(), rect.maxY()), | 24 min(rect.y(), rect.maxY()), |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 PassRefPtr<Image> ImageBitmap::bitmapImage() const | 191 PassRefPtr<Image> ImageBitmap::bitmapImage() const |
192 { | 192 { |
193 ASSERT((m_imageElement || m_bitmap || !m_bitmapRect.width() || !m_bitmapRect
.height()) && (!m_imageElement || !m_bitmap)); | 193 ASSERT((m_imageElement || m_bitmap || !m_bitmapRect.width() || !m_bitmapRect
.height()) && (!m_imageElement || !m_bitmap)); |
194 if (m_imageElement) | 194 if (m_imageElement) |
195 return m_imageElement->cachedImage()->image(); | 195 return m_imageElement->cachedImage()->image(); |
196 return m_bitmap; | 196 return m_bitmap; |
197 } | 197 } |
198 | 198 |
199 } | 199 } |
OLD | NEW |