| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Google, Inc. | 3 * Copyright (C) 2008, 2009 Google, Inc. |
| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 ASSERT(!width() && !height()); | 107 ASSERT(!width() && !height()); |
| 108 | 108 |
| 109 m_bitmap.setInfo(SkImageInfo::MakeN32Premul(newWidth, newHeight)); | 109 m_bitmap.setInfo(SkImageInfo::MakeN32Premul(newWidth, newHeight)); |
| 110 if (!m_bitmap.tryAllocPixels(m_allocator, 0)) | 110 if (!m_bitmap.tryAllocPixels(m_allocator, 0)) |
| 111 return false; | 111 return false; |
| 112 | 112 |
| 113 zeroFillPixelData(); | 113 zeroFillPixelData(); |
| 114 return true; | 114 return true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 PassRefPtr<NativeImageSkia> ImageFrame::asNewNativeImage() const | 117 const SkBitmap& ImageFrame::bitmap() const |
| 118 { | 118 { |
| 119 return NativeImageSkia::create(m_bitmap); | 119 return m_bitmap; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool ImageFrame::hasAlpha() const | 122 bool ImageFrame::hasAlpha() const |
| 123 { | 123 { |
| 124 return m_hasAlpha; | 124 return m_hasAlpha; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void ImageFrame::setHasAlpha(bool alpha) | 127 void ImageFrame::setHasAlpha(bool alpha) |
| 128 { | 128 { |
| 129 m_hasAlpha = alpha; | 129 m_hasAlpha = alpha; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 151 void ImageFrame::zeroFillFrameRect(const IntRect& rect) | 151 void ImageFrame::zeroFillFrameRect(const IntRect& rect) |
| 152 { | 152 { |
| 153 if (rect.isEmpty()) | 153 if (rect.isEmpty()) |
| 154 return; | 154 return; |
| 155 | 155 |
| 156 m_bitmap.eraseArea(rect, SkColorSetARGB(0, 0, 0, 0)); | 156 m_bitmap.eraseArea(rect, SkColorSetARGB(0, 0, 0, 0)); |
| 157 setHasAlpha(true); | 157 setHasAlpha(true); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |