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

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

Issue 1107973004: Pull cache out of GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixpicturerenderer.cpp Created 5 years, 7 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/GrClipMaskCache.h ('k') | src/gpu/GrContext.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 2012 Google Inc. 2 * Copyright 2012 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 "GrClipMaskManager.h" 8 #include "GrClipMaskManager.h"
9 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 #include "GrAAHairLinePathRenderer.h" 10 #include "GrAAHairLinePathRenderer.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 GrSurfaceDesc desc; 489 GrSurfaceDesc desc;
490 desc.fFlags = kRenderTarget_GrSurfaceFlag; 490 desc.fFlags = kRenderTarget_GrSurfaceFlag;
491 desc.fWidth = width; 491 desc.fWidth = width;
492 desc.fHeight = height; 492 desc.fHeight = height;
493 if (this->getContext()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { 493 if (this->getContext()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
494 desc.fConfig = kAlpha_8_GrPixelConfig; 494 desc.fConfig = kAlpha_8_GrPixelConfig;
495 } else { 495 } else {
496 desc.fConfig = kRGBA_8888_GrPixelConfig; 496 desc.fConfig = kRGBA_8888_GrPixelConfig;
497 } 497 }
498 498
499 return this->getContext()->refScratchTexture(desc, GrContext::kApprox_Scratc hTexMatch); 499 return this->getContext()->textureProvider()->refScratchTexture(
500 desc, GrTextureProvider::kApprox_ScratchTexMatch);
500 } 501 }
501 502
502 //////////////////////////////////////////////////////////////////////////////// 503 ////////////////////////////////////////////////////////////////////////////////
503 // Return the texture currently in the cache if it exists. Otherwise, return NUL L 504 // Return the texture currently in the cache if it exists. Otherwise, return NUL L
504 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID, 505 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID,
505 const SkIRect& clipSpaceIBoun ds) { 506 const SkIRect& clipSpaceIBoun ds) {
506 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds); 507 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds);
507 if (!cached) { 508 if (!cached) {
508 return NULL; 509 return NULL;
509 } 510 }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 fAACache.setContext(clipTarget->getContext()); 1115 fAACache.setContext(clipTarget->getContext());
1115 } 1116 }
1116 1117
1117 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment, 1118 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment,
1118 GrStencilSettings* settings) { 1119 GrStencilSettings* settings) {
1119 if (stencilAttachment) { 1120 if (stencilAttachment) {
1120 int stencilBits = stencilAttachment->bits(); 1121 int stencilBits = stencilAttachment->bits();
1121 this->adjustStencilParams(settings, fClipMode, stencilBits); 1122 this->adjustStencilParams(settings, fClipMode, stencilBits);
1122 } 1123 }
1123 } 1124 }
OLDNEW
« no previous file with comments | « src/gpu/GrClipMaskCache.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698