Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Side by Side Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 138013009: Culling API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Comments, formatting. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "SkDrawCommand.h" 10 #include "SkDrawCommand.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 const char* SkDrawCommand::GetCommandString(DrawType type) { 28 const char* SkDrawCommand::GetCommandString(DrawType type) {
29 switch (type) { 29 switch (type) {
30 case UNUSED: SkDEBUGFAIL("DrawType UNUSED\n"); break; 30 case UNUSED: SkDEBUGFAIL("DrawType UNUSED\n"); break;
31 case DRAW_CLEAR: return "Clear"; 31 case DRAW_CLEAR: return "Clear";
32 case CLIP_PATH: return "Clip Path"; 32 case CLIP_PATH: return "Clip Path";
33 case CLIP_REGION: return "Clip Region"; 33 case CLIP_REGION: return "Clip Region";
34 case CLIP_RECT: return "Clip Rect"; 34 case CLIP_RECT: return "Clip Rect";
35 case CLIP_RRECT: return "Clip RRect"; 35 case CLIP_RRECT: return "Clip RRect";
36 case PUSH_CULL: return "PushCull";
37 case POP_CULL: return "PopCull";
36 case CONCAT: return "Concat"; 38 case CONCAT: return "Concat";
37 case DRAW_BITMAP: return "Draw Bitmap"; 39 case DRAW_BITMAP: return "Draw Bitmap";
38 case DRAW_BITMAP_MATRIX: return "Draw Bitmap Matrix"; 40 case DRAW_BITMAP_MATRIX: return "Draw Bitmap Matrix";
39 case DRAW_BITMAP_NINE: return "Draw Bitmap Nine"; 41 case DRAW_BITMAP_NINE: return "Draw Bitmap Nine";
40 case DRAW_BITMAP_RECT_TO_RECT: return "Draw Bitmap Rect"; 42 case DRAW_BITMAP_RECT_TO_RECT: return "Draw Bitmap Rect";
41 case DRAW_DATA: return "Draw Data"; 43 case DRAW_DATA: return "Draw Data";
42 case DRAW_OVAL: return "Draw Oval"; 44 case DRAW_OVAL: return "Draw Oval";
43 case DRAW_PAINT: return "Draw Paint"; 45 case DRAW_PAINT: return "Draw Paint";
44 case DRAW_PATH: return "Draw Path"; 46 case DRAW_PATH: return "Draw Path";
45 case DRAW_PICTURE: return "Draw Picture"; 47 case DRAW_PICTURE: return "Draw Picture";
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 fDy = dy; 892 fDy = dy;
891 fDrawType = TRANSLATE; 893 fDrawType = TRANSLATE;
892 894
893 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); 895 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: "));
894 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); 896 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: "));
895 } 897 }
896 898
897 void SkTranslateCommand::execute(SkCanvas* canvas) { 899 void SkTranslateCommand::execute(SkCanvas* canvas) {
898 canvas->translate(fDx, fDy); 900 canvas->translate(fDx, fDy);
899 } 901 }
902
903 SkPushCullCommand::SkPushCullCommand(const SkRect& cullRect)
904 : fCullRect(cullRect) {
905 fDrawType = PUSH_CULL;
906 fInfo.push(SkObjectParser::RectToString(cullRect));
907 }
908
909 void SkPushCullCommand::execute(SkCanvas* canvas) {
910 //FIXME: add visualization overlay.
911 canvas->pushCull(fCullRect);
912 }
913
914 SkPopCullCommand::SkPopCullCommand() {
915 fDrawType = POP_CULL;
916 }
917
918 void SkPopCullCommand::execute(SkCanvas* canvas) {
919 canvas->popCull();
920 }
OLDNEW
« src/core/SkPictureRecord.h ('K') | « src/utils/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698