OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 | 8 |
9 | 9 |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
11 #include "SkDebugCanvas.h" | 11 #include "SkDebugCanvas.h" |
12 #include "SkDrawCommand.h" | 12 #include "SkDrawCommand.h" |
13 #include "SkDrawFilter.h" | 13 #include "SkDrawFilter.h" |
14 #include "SkDevice.h" | 14 #include "SkDevice.h" |
15 #include "SkXfermode.h" | 15 #include "SkXfermode.h" |
16 | 16 |
17 static SkBitmap make_noconfig_bm(int width, int height) { | |
18 SkBitmap bm; | |
19 bm.setConfig(SkBitmap::kNo_Config, width, height); | |
20 return bm; | |
21 } | |
22 | |
23 SkDebugCanvas::SkDebugCanvas(int width, int height) | 17 SkDebugCanvas::SkDebugCanvas(int width, int height) |
24 : INHERITED(make_noconfig_bm(width, height)) | 18 : INHERITED(width, height) |
25 , fWidth(width) | 19 , fWidth(width) |
26 , fHeight(height) | 20 , fHeight(height) |
27 , fFilter(false) | 21 , fFilter(false) |
28 , fIndex(0) | 22 , fIndex(0) |
29 , fOverdrawViz(false) | 23 , fOverdrawViz(false) |
30 , fOverdrawFilter(NULL) | 24 , fOverdrawFilter(NULL) |
31 , fOverrideTexFiltering(false) | 25 , fOverrideTexFiltering(false) |
32 , fTexOverrideFilter(NULL) | 26 , fTexOverrideFilter(NULL) |
33 , fOutstandingSaveCount(0) { | 27 , fOutstandingSaveCount(0) { |
34 fUserMatrix.reset(); | 28 fUserMatrix.reset(); |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 461 |
468 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { | 462 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { |
469 addDrawCommand(new SkTranslateCommand(dx, dy)); | 463 addDrawCommand(new SkTranslateCommand(dx, dy)); |
470 return true; | 464 return true; |
471 } | 465 } |
472 | 466 |
473 void SkDebugCanvas::toggleCommand(int index, bool toggle) { | 467 void SkDebugCanvas::toggleCommand(int index, bool toggle) { |
474 SkASSERT(index < fCommandVector.count()); | 468 SkASSERT(index < fCommandVector.count()); |
475 fCommandVector[index]->setVisible(toggle); | 469 fCommandVector[index]->setVisible(toggle); |
476 } | 470 } |
OLD | NEW |