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

Side by Side Diff: src/core/SkBBoxHierarchyRecord.cpp

Issue 203203004: Consolidate SkCanvas matrix virtuals. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated per review. Created 6 years, 9 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/core/SkBBoxHierarchyRecord.h ('k') | src/core/SkCanvas.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 #include "SkBBoxHierarchyRecord.h" 9 #include "SkBBoxHierarchyRecord.h"
10 #include "SkPictureStateTree.h" 10 #include "SkPictureStateTree.h"
(...skipping 25 matching lines...) Expand all
36 SaveFlags flags ) { 36 SaveFlags flags ) {
37 fStateTree->appendSaveLayer(this->writeStream().bytesWritten()); 37 fStateTree->appendSaveLayer(this->writeStream().bytesWritten());
38 return this->INHERITED::willSaveLayer(bounds, paint, flags); 38 return this->INHERITED::willSaveLayer(bounds, paint, flags);
39 } 39 }
40 40
41 void SkBBoxHierarchyRecord::willRestore() { 41 void SkBBoxHierarchyRecord::willRestore() {
42 fStateTree->appendRestore(); 42 fStateTree->appendRestore();
43 this->INHERITED::willRestore(); 43 this->INHERITED::willRestore();
44 } 44 }
45 45
46 void SkBBoxHierarchyRecord::didTranslate(SkScalar dx, SkScalar dy) {
47 fStateTree->appendTransform(getTotalMatrix());
48 INHERITED::didTranslate(dx, dy);
49 }
50
51 void SkBBoxHierarchyRecord::didScale(SkScalar sx, SkScalar sy) {
52 fStateTree->appendTransform(getTotalMatrix());
53 INHERITED::didScale(sx, sy);
54 }
55
56 void SkBBoxHierarchyRecord::didRotate(SkScalar degrees) {
57 fStateTree->appendTransform(getTotalMatrix());
58 INHERITED::didRotate(degrees);
59 }
60
61 void SkBBoxHierarchyRecord::didSkew(SkScalar sx, SkScalar sy) {
62 fStateTree->appendTransform(getTotalMatrix());
63 INHERITED::didSkew(sx, sy);
64 }
65
66 void SkBBoxHierarchyRecord::didConcat(const SkMatrix& matrix) { 46 void SkBBoxHierarchyRecord::didConcat(const SkMatrix& matrix) {
67 fStateTree->appendTransform(getTotalMatrix()); 47 fStateTree->appendTransform(getTotalMatrix());
68 INHERITED::didConcat(matrix); 48 INHERITED::didConcat(matrix);
69 } 49 }
70 50
71 void SkBBoxHierarchyRecord::didSetMatrix(const SkMatrix& matrix) { 51 void SkBBoxHierarchyRecord::didSetMatrix(const SkMatrix& matrix) {
72 fStateTree->appendTransform(getTotalMatrix()); 52 fStateTree->appendTransform(getTotalMatrix());
73 INHERITED::didSetMatrix(matrix); 53 INHERITED::didSetMatrix(matrix);
74 } 54 }
75 55
(...skipping 26 matching lines...) Expand all
102 82
103 bool SkBBoxHierarchyRecord::shouldRewind(void* data) { 83 bool SkBBoxHierarchyRecord::shouldRewind(void* data) {
104 // SkBBoxHierarchy::rewindInserts is called by SkPicture after the 84 // SkBBoxHierarchy::rewindInserts is called by SkPicture after the
105 // SkPicture has rewound its command stream. To match that rewind in the 85 // SkPicture has rewound its command stream. To match that rewind in the
106 // BBH, we rewind all draws that reference commands that were recorded 86 // BBH, we rewind all draws that reference commands that were recorded
107 // past the point to which the SkPicture has rewound, which is given by 87 // past the point to which the SkPicture has rewound, which is given by
108 // writeStream().bytesWritten(). 88 // writeStream().bytesWritten().
109 SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data ); 89 SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data );
110 return draw->fOffset >= writeStream().bytesWritten(); 90 return draw->fOffset >= writeStream().bytesWritten();
111 } 91 }
OLDNEW
« no previous file with comments | « src/core/SkBBoxHierarchyRecord.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698