OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "gm.h" | 8 #include "gm.h" |
9 #include "SkDebugCanvas.h" | 9 #include "SkDebugCanvas.h" |
10 #include "SkPictureFlat.h" | 10 #include "SkPictureFlat.h" |
| 11 #include "SkPictureRecorder.h" |
11 | 12 |
12 #define WARN(msg) \ | 13 #define WARN(msg) \ |
13 SkDebugf("%s:%d: %s\n", __FILE__, __LINE__, msg); | 14 SkDebugf("%s:%d: %s\n", __FILE__, __LINE__, msg); |
14 | 15 |
15 // Do the commands in 'input' match the supplied pattern? Note: this is a pretty | 16 // Do the commands in 'input' match the supplied pattern? Note: this is a pretty |
16 // heavy-weight operation since we are drawing the picture into a debug canvas | 17 // heavy-weight operation since we are drawing the picture into a debug canvas |
17 // to extract the commands. | 18 // to extract the commands. |
18 static bool check_pattern(SkPicture& input, const SkTDArray<DrawType> &pattern)
{ | 19 static bool check_pattern(SkPicture& input, const SkTDArray<DrawType> &pattern)
{ |
19 SkDebugCanvas debugCanvas(input.width(), input.height()); | 20 SkDebugCanvas debugCanvas(input.width(), input.height()); |
20 debugCanvas.setBounds(input.width(), input.height()); | 21 debugCanvas.setBounds(input.width(), input.height()); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 } | 408 } |
408 | 409 |
409 SkBitmap fCheckerboard; | 410 SkBitmap fCheckerboard; |
410 | 411 |
411 typedef skiagm::GM INHERITED; | 412 typedef skiagm::GM INHERITED; |
412 }; | 413 }; |
413 | 414 |
414 ////////////////////////////////////////////////////////////////////////////// | 415 ////////////////////////////////////////////////////////////////////////////// |
415 | 416 |
416 DEF_GM( return new OptimizationsGM; ) | 417 DEF_GM( return new OptimizationsGM; ) |
OLD | NEW |