| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkWindow.h" | 8 #include "SkWindow.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkOSMenu.h" | 10 #include "SkOSMenu.h" |
| 11 #include "SkSurface.h" | 11 #include "SkSurface.h" |
| 12 #include "SkSystemEventTypes.h" | 12 #include "SkSystemEventTypes.h" |
| 13 #include "SkTime.h" | 13 #include "SkTime.h" |
| 14 | 14 |
| 15 #define SK_EventDelayInval "\xd" "n" "\xa" "l" | 15 #define SK_EventDelayInval "\xd" "n" "\xa" "l" |
| 16 | 16 |
| 17 SkWindow::SkWindow() : fFocusView(NULL) { | 17 SkWindow::SkWindow() |
| 18 : fSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType) |
| 19 , fFocusView(NULL) |
| 20 { |
| 18 fClicks.reset(); | 21 fClicks.reset(); |
| 19 fWaitingOnInval = false; | 22 fWaitingOnInval = false; |
| 20 | 23 |
| 21 #ifdef SK_BUILD_FOR_WINCE | 24 #ifdef SK_BUILD_FOR_WINCE |
| 22 fColorType = kRGB_565_SkColorType; | 25 fColorType = kRGB_565_SkColorType; |
| 23 #else | 26 #else |
| 24 fColorType = kN32_SkColorType; | 27 fColorType = kN32_SkColorType; |
| 25 #endif | 28 #endif |
| 26 | 29 |
| 27 fMatrix.reset(); | 30 fMatrix.reset(); |
| 28 } | 31 } |
| 29 | 32 |
| 30 SkWindow::~SkWindow() { | 33 SkWindow::~SkWindow() { |
| 31 fClicks.deleteAll(); | 34 fClicks.deleteAll(); |
| 32 fMenus.deleteAll(); | 35 fMenus.deleteAll(); |
| 33 } | 36 } |
| 34 | 37 |
| 35 SkSurface* SkWindow::createSurface() { | 38 SkSurface* SkWindow::createSurface() { |
| 36 const SkBitmap& bm = this->getBitmap(); | 39 const SkBitmap& bm = this->getBitmap(); |
| 37 return SkSurface::NewRasterDirect(bm.info(), bm.getPixels(), bm.rowBytes()); | 40 return SkSurface::NewRasterDirect(bm.info(), bm.getPixels(), bm.rowBytes(),
&fSurfaceProps); |
| 38 } | 41 } |
| 39 | 42 |
| 40 void SkWindow::setMatrix(const SkMatrix& matrix) { | 43 void SkWindow::setMatrix(const SkMatrix& matrix) { |
| 41 if (fMatrix != matrix) { | 44 if (fMatrix != matrix) { |
| 42 fMatrix = matrix; | 45 fMatrix = matrix; |
| 43 this->inval(NULL); | 46 this->inval(NULL); |
| 44 } | 47 } |
| 45 } | 48 } |
| 46 | 49 |
| 47 void SkWindow::preConcat(const SkMatrix& matrix) { | 50 void SkWindow::preConcat(const SkMatrix& matrix) { |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 fClicks.remove(index); | 334 fClicks.remove(index); |
| 332 handled = true; | 335 handled = true; |
| 333 } | 336 } |
| 334 break; | 337 break; |
| 335 default: | 338 default: |
| 336 // Do nothing | 339 // Do nothing |
| 337 break; | 340 break; |
| 338 } | 341 } |
| 339 return handled; | 342 return handled; |
| 340 } | 343 } |
| OLD | NEW |