| 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 "SkWindow.h" | 8 #include "SkWindow.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 void SkWindow::resize(int width, int height, SkBitmap::Config config) | 97 void SkWindow::resize(int width, int height, SkBitmap::Config config) |
| 98 { | 98 { |
| 99 if (config == SkBitmap::kNo_Config) | 99 if (config == SkBitmap::kNo_Config) |
| 100 config = fConfig; | 100 config = fConfig; |
| 101 | 101 |
| 102 if (width != fBitmap.width() || height != fBitmap.height() || config != fCon
fig) | 102 if (width != fBitmap.width() || height != fBitmap.height() || config != fCon
fig) |
| 103 { | 103 { |
| 104 fConfig = config; | 104 fConfig = config; |
| 105 fBitmap.setConfig(config, width, height); | 105 fBitmap.setConfig(config, width, height, 0, kOpaque_SkAlphaType); |
| 106 fBitmap.allocPixels(); | 106 fBitmap.allocPixels(); |
| 107 fBitmap.setIsOpaque(true); | |
| 108 | 107 |
| 109 this->setSize(SkIntToScalar(width), SkIntToScalar(height)); | 108 this->setSize(SkIntToScalar(width), SkIntToScalar(height)); |
| 110 this->inval(NULL); | 109 this->inval(NULL); |
| 111 } | 110 } |
| 112 } | 111 } |
| 113 | 112 |
| 114 void SkWindow::eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) | 113 void SkWindow::eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) |
| 115 { | 114 { |
| 116 fBitmap.eraseARGB(a, r, g, b); | 115 fBitmap.eraseARGB(a, r, g, b); |
| 117 } | 116 } |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 fClicks.remove(index); | 405 fClicks.remove(index); |
| 407 handled = true; | 406 handled = true; |
| 408 } | 407 } |
| 409 break; | 408 break; |
| 410 default: | 409 default: |
| 411 // Do nothing | 410 // Do nothing |
| 412 break; | 411 break; |
| 413 } | 412 } |
| 414 return handled; | 413 return handled; |
| 415 } | 414 } |
| OLD | NEW |