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

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

Issue 844613002: Allow non-atlasable layer to still be hoisted (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: refactor Created 5 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
« no previous file with comments | « no previous file | src/gpu/GrLayerHoister.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 "GrAtlas.h" 8 #include "GrAtlas.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "GrLayerCache.h" 10 #include "GrLayerCache.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 *needsRendering = false; 246 *needsRendering = false;
247 return true; 247 return true;
248 } 248 }
249 249
250 // TODO: make the test for exact match depend on the image filters themselve s 250 // TODO: make the test for exact match depend on the image filters themselve s
251 GrContext::ScratchTexMatch usage = GrContext::kApprox_ScratchTexMatch; 251 GrContext::ScratchTexMatch usage = GrContext::kApprox_ScratchTexMatch;
252 if (layer->fFilter) { 252 if (layer->fFilter) {
253 usage = GrContext::kExact_ScratchTexMatch; 253 usage = GrContext::kExact_ScratchTexMatch;
254 } 254 }
255 255
256 SkAutoTUnref<GrTexture> tex( 256 SkAutoTUnref<GrTexture> tex(fContext->refScratchTexture(desc, usage));
257 fContext->refScratchTexture(desc, usage));
258
259 if (!tex) { 257 if (!tex) {
260 return false; 258 return false;
261 } 259 }
262 260
263 layer->setTexture(tex, SkIRect::MakeWH(desc.fWidth, desc.fHeight)); 261 layer->setTexture(tex, SkIRect::MakeWH(desc.fWidth, desc.fHeight));
264 layer->setLocked(true); 262 layer->setLocked(true);
265 *needsRendering = true; 263 *needsRendering = true;
266 return true; 264 return true;
267 } 265 }
268 266
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 fileName.appendf("\\%d", layer->fKey.pictureID()); 503 fileName.appendf("\\%d", layer->fKey.pictureID());
506 for (int i = 0; i < layer->fKey.keySize(); ++i) { 504 for (int i = 0; i < layer->fKey.keySize(); ++i) {
507 fileName.appendf("-%d", layer->fKey.key()[i]); 505 fileName.appendf("-%d", layer->fKey.key()[i]);
508 } 506 }
509 fileName.appendf(".png"); 507 fileName.appendf(".png");
510 508
511 layer->texture()->surfacePriv().savePixels(fileName.c_str()); 509 layer->texture()->surfacePriv().savePixels(fileName.c_str());
512 } 510 }
513 } 511 }
514 #endif 512 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698