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

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

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/gpu/GrLayerAtlas.cpp ('k') | src/gpu/GrResourceCache.h » ('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 "GrLayerAtlas.h" 8 #include "GrLayerAtlas.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n eedsRendering) { 248 bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n eedsRendering) {
249 if (layer->locked()) { 249 if (layer->locked()) {
250 // This layer is already locked 250 // This layer is already locked
251 *needsRendering = false; 251 *needsRendering = false;
252 return true; 252 return true;
253 } 253 }
254 254
255 // TODO: make the test for exact match depend on the image filters themselve s 255 // TODO: make the test for exact match depend on the image filters themselve s
256 SkAutoTUnref<GrTexture> tex; 256 SkAutoTUnref<GrTexture> tex;
257 if (layer->fFilter) { 257 if (layer->fFilter) {
258 tex.reset(fContext->textureProvider()->createTexture(desc, SkBudgeted::k Yes)); 258 tex.reset(fContext->textureProvider()->createTexture(desc, true));
259 } else { 259 } else {
260 tex.reset(fContext->textureProvider()->createApproxTexture(desc)); 260 tex.reset(fContext->textureProvider()->createApproxTexture(desc));
261 } 261 }
262 262
263 if (!tex) { 263 if (!tex) {
264 return false; 264 return false;
265 } 265 }
266 266
267 layer->setTexture(tex, SkIRect::MakeWH(desc.fWidth, desc.fHeight), false); 267 layer->setTexture(tex, SkIRect::MakeWH(desc.fWidth, desc.fHeight), false);
268 layer->setLocked(true); 268 layer->setLocked(true);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 fileName.appendf("\\%d", layer->fKey.pictureID()); 548 fileName.appendf("\\%d", layer->fKey.pictureID());
549 for (int i = 0; i < layer->fKey.keySize(); ++i) { 549 for (int i = 0; i < layer->fKey.keySize(); ++i) {
550 fileName.appendf("-%d", layer->fKey.key()[i]); 550 fileName.appendf("-%d", layer->fKey.key()[i]);
551 } 551 }
552 fileName.appendf(".png"); 552 fileName.appendf(".png");
553 553
554 layer->texture()->surfacePriv().savePixels(fileName.c_str()); 554 layer->texture()->surfacePriv().savePixels(fileName.c_str());
555 } 555 }
556 } 556 }
557 #endif 557 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrLayerAtlas.cpp ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698