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

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

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 11 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
« no previous file with comments | « src/utils/SkPDFRasterizer.cpp ('k') | src/utils/mac/SkCreateCGImageRef.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 drawTo(canvas, fCommandVector.count() - 1); 67 drawTo(canvas, fCommandVector.count() - 1);
68 } 68 }
69 } 69 }
70 70
71 void SkDebugCanvas::applyUserTransform(SkCanvas* canvas) { 71 void SkDebugCanvas::applyUserTransform(SkCanvas* canvas) {
72 canvas->concat(fUserMatrix); 72 canvas->concat(fUserMatrix);
73 } 73 }
74 74
75 int SkDebugCanvas::getCommandAtPoint(int x, int y, int index) { 75 int SkDebugCanvas::getCommandAtPoint(int x, int y, int index) {
76 SkBitmap bitmap; 76 SkBitmap bitmap;
77 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); 77 bitmap.allocPixels(SkImageInfo::MakeN32Premul(1, 1));
78 bitmap.allocPixels();
79 78
80 SkCanvas canvas(bitmap); 79 SkCanvas canvas(bitmap);
81 canvas.translate(SkIntToScalar(-x), SkIntToScalar(-y)); 80 canvas.translate(SkIntToScalar(-x), SkIntToScalar(-y));
82 applyUserTransform(&canvas); 81 applyUserTransform(&canvas);
83 82
84 int layer = 0; 83 int layer = 0;
85 SkColor prev = bitmap.getColor(0,0); 84 SkColor prev = bitmap.getColor(0,0);
86 for (int i = 0; i < index; i++) { 85 for (int i = 0; i < index; i++) {
87 if (fCommandVector[i]->isVisible()) { 86 if (fCommandVector[i]->isVisible()) {
88 fCommandVector[i]->execute(&canvas); 87 fCommandVector[i]->execute(&canvas);
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 467
469 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { 468 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) {
470 addDrawCommand(new SkTranslateCommand(dx, dy)); 469 addDrawCommand(new SkTranslateCommand(dx, dy));
471 return true; 470 return true;
472 } 471 }
473 472
474 void SkDebugCanvas::toggleCommand(int index, bool toggle) { 473 void SkDebugCanvas::toggleCommand(int index, bool toggle) {
475 SkASSERT(index < fCommandVector.count()); 474 SkASSERT(index < fCommandVector.count());
476 fCommandVector[index]->setVisible(toggle); 475 fCommandVector[index]->setVisible(toggle);
477 } 476 }
OLDNEW
« no previous file with comments | « src/utils/SkPDFRasterizer.cpp ('k') | src/utils/mac/SkCreateCGImageRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698