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

Side by Side Diff: src/utils/SkCanvasStack.cpp

Issue 99753002: Fix 'i-i' to 'i-1' in SkCanvasStack. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years 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 | « no previous file | no next file » | 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 2013 Google Inc. 3 * Copyright 2013 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 #include "SkCanvasStack.h" 8 #include "SkCanvasStack.h"
9 9
10 SkCanvasStack::SkCanvasStack(int width, int height) 10 SkCanvasStack::SkCanvasStack(int width, int height)
(...skipping 17 matching lines...) Expand all
28 data->requiredClip.setRect(canvasBounds); 28 data->requiredClip.setRect(canvasBounds);
29 29
30 // subtract this region from the canvas objects already on the stack. 30 // subtract this region from the canvas objects already on the stack.
31 // This ensures they do not draw into the space occupied by the layers 31 // This ensures they do not draw into the space occupied by the layers
32 // above them. 32 // above them.
33 for (int i = fList.count() - 1; i > 0; --i) { 33 for (int i = fList.count() - 1; i > 0; --i) {
34 SkIRect localBounds = canvasBounds; 34 SkIRect localBounds = canvasBounds;
35 localBounds.offset(origin - fCanvasData[i-1].origin); 35 localBounds.offset(origin - fCanvasData[i-1].origin);
36 36
37 fCanvasData[i-1].requiredClip.op(localBounds, SkRegion::kDifference_ Op); 37 fCanvasData[i-1].requiredClip.op(localBounds, SkRegion::kDifference_ Op);
38 fList[i-i]->clipRegion(fCanvasData[i-1].requiredClip); 38 fList[i-1]->clipRegion(fCanvasData[i-1].requiredClip);
39 } 39 }
40 } 40 }
41 SkASSERT(fList.count() == fCanvasData.count()); 41 SkASSERT(fList.count() == fCanvasData.count());
42 } 42 }
43 43
44 void SkCanvasStack::removeAll() { 44 void SkCanvasStack::removeAll() {
45 fCanvasData.reset(); 45 fCanvasData.reset();
46 this->INHERITED::removeAll(); 46 this->INHERITED::removeAll();
47 } 47 }
48 48
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 SkASSERT(fList.count() == fCanvasData.count()); 99 SkASSERT(fList.count() == fCanvasData.count());
100 for (int i = 0; i < fList.count(); ++i) { 100 for (int i = 0; i < fList.count(); ++i) {
101 SkRegion tempRegion; 101 SkRegion tempRegion;
102 deviceRgn.translate(-fCanvasData[i].origin.x(), 102 deviceRgn.translate(-fCanvasData[i].origin.x(),
103 -fCanvasData[i].origin.y(), &tempRegion); 103 -fCanvasData[i].origin.y(), &tempRegion);
104 tempRegion.op(fCanvasData[i].requiredClip, SkRegion::kIntersect_Op); 104 tempRegion.op(fCanvasData[i].requiredClip, SkRegion::kIntersect_Op);
105 fList[i]->clipRegion(tempRegion, op); 105 fList[i]->clipRegion(tempRegion, op);
106 } 106 }
107 return this->SkCanvas::clipRegion(deviceRgn, op); 107 return this->SkCanvas::clipRegion(deviceRgn, op);
108 } 108 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698