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

Side by Side Diff: src/gpu/GrLayerHoister.cpp

Issue 553983003: Revert of Fix two SkRecord-backed layer hoisting bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | src/gpu/GrRecordReplaceDraw.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrLayerCache.h" 8 #include "GrLayerCache.h"
9 #include "GrLayerHoister.h" 9 #include "GrLayerHoister.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // TODO: ensure none of the atlased layers contain a clear call! 88 // TODO: ensure none of the atlased layers contain a clear call!
89 atlasCanvas->drawRect(bound, paint); 89 atlasCanvas->drawRect(bound, paint);
90 90
91 // info.fCTM maps the layer's top/left to the origin. 91 // info.fCTM maps the layer's top/left to the origin.
92 // Since this layer is atlased, the top/left corner needs 92 // Since this layer is atlased, the top/left corner needs
93 // to be offset to the correct location in the backing texture. 93 // to be offset to the correct location in the backing texture.
94 atlasCanvas->translate(bound.fLeft, bound.fTop); 94 atlasCanvas->translate(bound.fLeft, bound.fTop);
95 atlasCanvas->concat(layer->ctm()); 95 atlasCanvas->concat(layer->ctm());
96 96
97 SkRecordPartialDraw(*picture->fRecord.get(), atlasCanvas, bound, 97 SkRecordPartialDraw(*picture->fRecord.get(), atlasCanvas, bound,
98 layer->start()+1, layer->stop()); 98 layer->start(), layer->stop());
99 99
100 atlasCanvas->restore(); 100 atlasCanvas->restore();
101 } 101 }
102 102
103 atlasCanvas->flush(); 103 atlasCanvas->flush();
104 } 104 }
105 105
106 // Render the non-atlased layers that require it 106 // Render the non-atlased layers that require it
107 for (int i = 0; i < nonAtlased.count(); ++i) { 107 for (int i = 0; i < nonAtlased.count(); ++i) {
108 GrCachedLayer* layer = nonAtlased[i]; 108 GrCachedLayer* layer = nonAtlased[i];
(...skipping 13 matching lines...) Expand all
122 SkIntToScalar(layer->rect().width()), 122 SkIntToScalar(layer->rect().width()),
123 SkIntToScalar(layer->rect().height())); 123 SkIntToScalar(layer->rect().height()));
124 124
125 layerCanvas->clipRect(bound); // TODO: still useful? 125 layerCanvas->clipRect(bound); // TODO: still useful?
126 126
127 layerCanvas->clear(SK_ColorTRANSPARENT); 127 layerCanvas->clear(SK_ColorTRANSPARENT);
128 128
129 layerCanvas->concat(layer->ctm()); 129 layerCanvas->concat(layer->ctm());
130 130
131 SkRecordPartialDraw(*picture->fRecord.get(), layerCanvas, bound, 131 SkRecordPartialDraw(*picture->fRecord.get(), layerCanvas, bound,
132 layer->start()+1, layer->stop()); 132 layer->start(), layer->stop());
133 133
134 layerCanvas->flush(); 134 layerCanvas->flush();
135 } 135 }
136 } 136 }
137 137
138 void GrLayerHoister::UnlockLayers(GrLayerCache* layerCache, const SkPicture* pic ture) { 138 void GrLayerHoister::UnlockLayers(GrLayerCache* layerCache, const SkPicture* pic ture) {
139 SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey(); 139 SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
140 140
141 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key); 141 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key);
142 SkASSERT(data); 142 SkASSERT(data);
(...skipping 15 matching lines...) Expand all
158 #if DISABLE_CACHING 158 #if DISABLE_CACHING
159 // This code completely clears out the atlas. It is required when 159 // This code completely clears out the atlas. It is required when
160 // caching is disabled so the atlas doesn't fill up and force more 160 // caching is disabled so the atlas doesn't fill up and force more
161 // free floating layers 161 // free floating layers
162 layerCache->purge(picture->uniqueID()); 162 layerCache->purge(picture->uniqueID());
163 163
164 layerCache->purgeAll(); 164 layerCache->purgeAll();
165 #endif 165 #endif
166 } 166 }
167 167
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrRecordReplaceDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698