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

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

Issue 145723007: Fix a problem with hiDPI filters vs tiled SkPicture playback. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix nit 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
« no previous file with comments | « no previous file | tests/ImageFilterTest.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 "SkPictureStateTree.h" 9 #include "SkPictureStateTree.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 , fCurrentMatrix(NULL) 96 , fCurrentMatrix(NULL)
97 , fPlaybackIndex(0) 97 , fPlaybackIndex(0)
98 , fSave(false) 98 , fSave(false)
99 , fValid(true) { 99 , fValid(true) {
100 } 100 }
101 101
102 uint32_t SkPictureStateTree::Iterator::draw() { 102 uint32_t SkPictureStateTree::Iterator::draw() {
103 SkASSERT(this->isValid()); 103 SkASSERT(this->isValid());
104 if (fPlaybackIndex >= fDraws->count()) { 104 if (fPlaybackIndex >= fDraws->count()) {
105 // restore back to where we started 105 // restore back to where we started
106 fCanvas->setMatrix(fPlaybackMatrix);
106 if (fCurrentNode->fFlags & Node::kSaveLayer_Flag) { fCanvas->restore(); } 107 if (fCurrentNode->fFlags & Node::kSaveLayer_Flag) { fCanvas->restore(); }
107 fCurrentNode = fCurrentNode->fParent; 108 fCurrentNode = fCurrentNode->fParent;
108 while (NULL != fCurrentNode) { 109 while (NULL != fCurrentNode) {
109 if (fCurrentNode->fFlags & Node::kSave_Flag) { fCanvas->restore(); } 110 if (fCurrentNode->fFlags & Node::kSave_Flag) { fCanvas->restore(); }
110 if (fCurrentNode->fFlags & Node::kSaveLayer_Flag) { fCanvas->restore (); } 111 if (fCurrentNode->fFlags & Node::kSaveLayer_Flag) { fCanvas->restore (); }
111 fCurrentNode = fCurrentNode->fParent; 112 fCurrentNode = fCurrentNode->fParent;
112 } 113 }
113 fCanvas->setMatrix(fPlaybackMatrix);
114 return kDrawComplete; 114 return kDrawComplete;
115 } 115 }
116 116
117 Draw* draw = static_cast<Draw*>((*fDraws)[fPlaybackIndex]); 117 Draw* draw = static_cast<Draw*>((*fDraws)[fPlaybackIndex]);
118 Node* targetNode = draw->fNode; 118 Node* targetNode = draw->fNode;
119 119
120 if (fSave) { 120 if (fSave) {
121 fCanvas->save(SkCanvas::kClip_SaveFlag); 121 fCanvas->save(SkCanvas::kClip_SaveFlag);
122 fSave = false; 122 fSave = false;
123 } 123 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (fCurrentMatrix != draw->fMatrix) { 177 if (fCurrentMatrix != draw->fMatrix) {
178 SkMatrix tmp = *draw->fMatrix; 178 SkMatrix tmp = *draw->fMatrix;
179 tmp.postConcat(fPlaybackMatrix); 179 tmp.postConcat(fPlaybackMatrix);
180 fCanvas->setMatrix(tmp); 180 fCanvas->setMatrix(tmp);
181 fCurrentMatrix = draw->fMatrix; 181 fCurrentMatrix = draw->fMatrix;
182 } 182 }
183 183
184 ++fPlaybackIndex; 184 ++fPlaybackIndex;
185 return draw->fOffset; 185 return draw->fOffset;
186 } 186 }
OLDNEW
« no previous file with comments | « no previous file | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698