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

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

Issue 1139753002: Refactor GrBufferAllocPools to use resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up 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
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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()->textureProvider()->refScratchTexture( 499 return this->getContext()->textureProvider()->refScratchTexture(
500 desc, GrTextureProvider::kApprox_ScratchTexMatch); 500 desc, GrTextureProvider::kApprox_ScratchMatch);
501 } 501 }
502 502
503 //////////////////////////////////////////////////////////////////////////////// 503 ////////////////////////////////////////////////////////////////////////////////
504 // 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
505 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID, 505 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID,
506 const SkIRect& clipSpaceIBoun ds) { 506 const SkIRect& clipSpaceIBoun ds) {
507 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds); 507 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds);
508 if (!cached) { 508 if (!cached) {
509 return NULL; 509 return NULL;
510 } 510 }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 fAACache.setContext(clipTarget->getContext()); 1115 fAACache.setContext(clipTarget->getContext());
1116 } 1116 }
1117 1117
1118 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment, 1118 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment,
1119 GrStencilSettings* settings) { 1119 GrStencilSettings* settings) {
1120 if (stencilAttachment) { 1120 if (stencilAttachment) {
1121 int stencilBits = stencilAttachment->bits(); 1121 int stencilBits = stencilAttachment->bits();
1122 this->adjustStencilParams(settings, fClipMode, stencilBits); 1122 this->adjustStencilParams(settings, fClipMode, stencilBits);
1123 } 1123 }
1124 } 1124 }
OLDNEW
« no previous file with comments | « src/gpu/GrClipMaskCache.h ('k') | src/gpu/GrContext.cpp » ('j') | src/gpu/GrResourceProvider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698