OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 | 9 |
10 #if defined(SK_BUILD_FOR_WIN) | 10 #if defined(SK_BUILD_FOR_WIN) |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // Do the SetDIBitsToDevice. | 195 // Do the SetDIBitsToDevice. |
196 // | 196 // |
197 // TODO(wjmaclean): | 197 // TODO(wjmaclean): |
198 // Fix this call to handle SkBitmaps that have rowBytes != width, | 198 // Fix this call to handle SkBitmaps that have rowBytes != width, |
199 // i.e. may have padding at the end of lines. The SkASSERT below | 199 // i.e. may have padding at the end of lines. The SkASSERT below |
200 // may be ignored by builds, and the only obviously safe option | 200 // may be ignored by builds, and the only obviously safe option |
201 // seems to be to copy the bitmap to a temporary (contiguous) | 201 // seems to be to copy the bitmap to a temporary (contiguous) |
202 // buffer before passing to SetDIBitsToDevice(). | 202 // buffer before passing to SetDIBitsToDevice(). |
203 SkASSERT(bitmap.width() * bitmap.bytesPerPixel() == bitmap.rowBytes()); | 203 SkASSERT(bitmap.width() * bitmap.bytesPerPixel() == bitmap.rowBytes()); |
204 bitmap.lockPixels(); | 204 bitmap.lockPixels(); |
205 int iRet = SetDIBitsToDevice(hdc, | 205 int ret = SetDIBitsToDevice(hdc, |
206 0, 0, | 206 0, 0, |
207 bitmap.width(), bitmap.height(), | 207 bitmap.width(), bitmap.height(), |
208 0, 0, | 208 0, 0, |
209 0, bitmap.height(), | 209 0, bitmap.height(), |
210 bitmap.getPixels(), | 210 bitmap.getPixels(), |
211 &bmi, | 211 &bmi, |
212 DIB_RGB_COLORS); | 212 DIB_RGB_COLORS); |
| 213 (void)ret; // we're ignoring potential failures for now. |
213 bitmap.unlockPixels(); | 214 bitmap.unlockPixels(); |
214 } | 215 } |
215 } | 216 } |
216 | 217 |
217 #if 0 | 218 #if 0 |
218 void SkOSWindow::updateSize() | 219 void SkOSWindow::updateSize() |
219 { | 220 { |
220 RECT r; | 221 RECT r; |
221 GetWindowRect((HWND)this->getHWND(), &r); | 222 GetWindowRect((HWND)this->getHWND(), &r); |
222 this->resize(r.right - r.left, r.bottom - r.top); | 223 this->resize(r.right - r.left, r.bottom - r.top); |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 break; | 603 break; |
603 #endif // SK_ANGLE | 604 #endif // SK_ANGLE |
604 #endif // SK_SUPPORT_GPU | 605 #endif // SK_SUPPORT_GPU |
605 default: | 606 default: |
606 SkASSERT(false); | 607 SkASSERT(false); |
607 break; | 608 break; |
608 } | 609 } |
609 } | 610 } |
610 | 611 |
611 #endif | 612 #endif |
OLD | NEW |