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 * Copyright (C) 2009 Holger Hans Peter Freyther | 4 * Copyright (C) 2009 Holger Hans Peter Freyther |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 void RGBA32Buffer::zeroFill() | 69 void RGBA32Buffer::zeroFill() |
70 { | 70 { |
71 if (m_pixmap.isNull() && !m_image.isNull()) { | 71 if (m_pixmap.isNull() && !m_image.isNull()) { |
72 m_pixmap = QPixmap(m_image.width(), m_image.height()); | 72 m_pixmap = QPixmap(m_image.width(), m_image.height()); |
73 m_image = QImage(); | 73 m_image = QImage(); |
74 } | 74 } |
75 m_pixmap.fill(QColor(0, 0, 0, 0)); | 75 m_pixmap.fill(QColor(0, 0, 0, 0)); |
76 } | 76 } |
77 | 77 |
78 void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other) | 78 bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other) |
79 { | 79 { |
80 if (this == &other) | 80 if (this == &other) |
81 return; | 81 return true; |
82 | 82 |
83 m_image = other.m_image; | 83 m_image = other.m_image; |
84 m_pixmap = other.m_pixmap; | 84 m_pixmap = other.m_pixmap; |
85 m_size = other.m_size; | 85 m_size = other.m_size; |
86 m_hasAlpha = other.m_hasAlpha; | 86 m_hasAlpha = other.m_hasAlpha; |
| 87 return true; |
87 } | 88 } |
88 | 89 |
89 bool RGBA32Buffer::setSize(int newWidth, int newHeight) | 90 bool RGBA32Buffer::setSize(int newWidth, int newHeight) |
90 { | 91 { |
91 // This function should only be called once, it will leak memory | 92 // This function should only be called once, it will leak memory |
92 // otherwise. | 93 // otherwise. |
93 ASSERT(width() == 0 && height() == 0); | 94 ASSERT(width() == 0 && height() == 0); |
94 | 95 |
95 m_size = IntSize(newWidth, newHeight); | 96 m_size = IntSize(newWidth, newHeight); |
96 m_image = QImage(); | 97 m_image = QImage(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 { | 142 { |
142 return m_size.width(); | 143 return m_size.width(); |
143 } | 144 } |
144 | 145 |
145 int RGBA32Buffer::height() const | 146 int RGBA32Buffer::height() const |
146 { | 147 { |
147 return m_size.height(); | 148 return m_size.height(); |
148 } | 149 } |
149 | 150 |
150 } | 151 } |
OLD | NEW |