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

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

Issue 682223002: rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: const Created 6 years, 1 month 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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrClipMaskManager.h" 9 #include "GrClipMaskManager.h"
10 #include "GrAAConvexPathRenderer.h" 10 #include "GrAAConvexPathRenderer.h"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 drawState->addColorProcessor( 474 drawState->addColorProcessor(
475 GrTextureDomainEffect::Create(srcMask, 475 GrTextureDomainEffect::Create(srcMask,
476 sampleM, 476 sampleM,
477 GrTextureDomain::MakeTexelDomain(srcMask, srcBound), 477 GrTextureDomain::MakeTexelDomain(srcMask, srcBound),
478 GrTextureDomain::kDecal_Mode, 478 GrTextureDomain::kDecal_Mode,
479 GrTextureParams::kNone_FilterMode))->unref (); 479 GrTextureParams::kNone_FilterMode))->unref ();
480 fGpu->drawSimpleRect(SkRect::Make(dstBound)); 480 fGpu->drawSimpleRect(SkRect::Make(dstBound));
481 } 481 }
482 482
483 GrTexture* GrClipMaskManager::createTempMask(int width, int height) { 483 GrTexture* GrClipMaskManager::createTempMask(int width, int height) {
484 GrTextureDesc desc; 484 GrSurfaceDesc desc;
485 desc.fFlags = kRenderTarget_GrTextureFlagBit|kNoStencil_GrTextureFlagBit; 485 desc.fFlags = kRenderTarget_GrSurfaceFlag|kNoStencil_GrSurfaceFlag;
486 desc.fWidth = width; 486 desc.fWidth = width;
487 desc.fHeight = height; 487 desc.fHeight = height;
488 desc.fConfig = kAlpha_8_GrPixelConfig; 488 desc.fConfig = kAlpha_8_GrPixelConfig;
489 489
490 return fGpu->getContext()->refScratchTexture(desc, GrContext::kApprox_Scratc hTexMatch); 490 return fGpu->getContext()->refScratchTexture(desc, GrContext::kApprox_Scratc hTexMatch);
491 } 491 }
492 492
493 //////////////////////////////////////////////////////////////////////////////// 493 ////////////////////////////////////////////////////////////////////////////////
494 // Return the texture currently in the cache if it exists. Otherwise, return NUL L 494 // Return the texture currently in the cache if it exists. Otherwise, return NUL L
495 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID, 495 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID,
496 const SkIRect& clipSpaceIBoun ds) { 496 const SkIRect& clipSpaceIBoun ds) {
497 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds); 497 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds);
498 if (!cached) { 498 if (!cached) {
499 return NULL; 499 return NULL;
500 } 500 }
501 501
502 return fAACache.getLastMask(); 502 return fAACache.getLastMask();
503 } 503 }
504 504
505 //////////////////////////////////////////////////////////////////////////////// 505 ////////////////////////////////////////////////////////////////////////////////
506 // Allocate a texture in the texture cache. This function returns the texture 506 // Allocate a texture in the texture cache. This function returns the texture
507 // allocated (or NULL on error). 507 // allocated (or NULL on error).
508 GrTexture* GrClipMaskManager::allocMaskTexture(int32_t elementsGenID, 508 GrTexture* GrClipMaskManager::allocMaskTexture(int32_t elementsGenID,
509 const SkIRect& clipSpaceIBounds, 509 const SkIRect& clipSpaceIBounds,
510 bool willUpload) { 510 bool willUpload) {
511 // Since we are setting up the cache we should free up the 511 // Since we are setting up the cache we should free up the
512 // currently cached mask so it can be reused. 512 // currently cached mask so it can be reused.
513 fAACache.reset(); 513 fAACache.reset();
514 514
515 GrTextureDesc desc; 515 GrSurfaceDesc desc;
516 desc.fFlags = willUpload ? kNone_GrTextureFlags : kRenderTarget_GrTextureFla gBit; 516 desc.fFlags = willUpload ? kNone_GrSurfaceFlags : kRenderTarget_GrSurfaceFla g;
517 desc.fWidth = clipSpaceIBounds.width(); 517 desc.fWidth = clipSpaceIBounds.width();
518 desc.fHeight = clipSpaceIBounds.height(); 518 desc.fHeight = clipSpaceIBounds.height();
519 desc.fConfig = kRGBA_8888_GrPixelConfig; 519 desc.fConfig = kRGBA_8888_GrPixelConfig;
520 if (willUpload || this->getContext()->isConfigRenderable(kAlpha_8_GrPixelCon fig, false)) { 520 if (willUpload || this->getContext()->isConfigRenderable(kAlpha_8_GrPixelCon fig, false)) {
521 // We would always like A8 but it isn't supported on all platforms 521 // We would always like A8 but it isn't supported on all platforms
522 desc.fConfig = kAlpha_8_GrPixelConfig; 522 desc.fConfig = kAlpha_8_GrPixelConfig;
523 } 523 }
524 524
525 fAACache.acquireMask(elementsGenID, desc, clipSpaceIBounds); 525 fAACache.acquireMask(elementsGenID, desc, clipSpaceIBounds);
526 return fAACache.getLastMask(); 526 return fAACache.getLastMask();
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 1130
1131 // TODO: dynamically attach a stencil buffer 1131 // TODO: dynamically attach a stencil buffer
1132 int stencilBits = 0; 1132 int stencilBits = 0;
1133 GrStencilBuffer* stencilBuffer = 1133 GrStencilBuffer* stencilBuffer =
1134 drawState.getRenderTarget()->getStencilBuffer(); 1134 drawState.getRenderTarget()->getStencilBuffer();
1135 if (stencilBuffer) { 1135 if (stencilBuffer) {
1136 stencilBits = stencilBuffer->bits(); 1136 stencilBits = stencilBuffer->bits();
1137 this->adjustStencilParams(settings, clipMode, stencilBits); 1137 this->adjustStencilParams(settings, clipMode, stencilBits);
1138 } 1138 }
1139 } 1139 }
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