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

Side by Side Diff: src/gpu/GrAADistanceFieldPathRenderer.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 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 "GrAADistanceFieldPathRenderer.h" 9 #include "GrAADistanceFieldPathRenderer.h"
10 10
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 // Create a new atlas 559 // Create a new atlas
560 GrSurfaceDesc desc; 560 GrSurfaceDesc desc;
561 desc.fFlags = kNone_GrSurfaceFlags; 561 desc.fFlags = kNone_GrSurfaceFlags;
562 desc.fWidth = ATLAS_TEXTURE_WIDTH; 562 desc.fWidth = ATLAS_TEXTURE_WIDTH;
563 desc.fHeight = ATLAS_TEXTURE_HEIGHT; 563 desc.fHeight = ATLAS_TEXTURE_HEIGHT;
564 desc.fConfig = kAlpha_8_GrPixelConfig; 564 desc.fConfig = kAlpha_8_GrPixelConfig;
565 565
566 // We don't want to flush the context so we claim we're in the middle of flu shing so as to 566 // We don't want to flush the context so we claim we're in the middle of flu shing so as to
567 // guarantee we do not recieve a texture with pending IO 567 // guarantee we do not recieve a texture with pending IO
568 GrTexture* texture = context->textureProvider()->refScratchTexture( 568 GrTexture* texture = context->textureProvider()->refScratchTexture(
569 desc, GrTextureProvider::kApprox_ScratchTexMatch, true); 569 desc, GrTextureProvider::kApprox_ScratchMatch, true);
570 if (texture) { 570 if (texture) {
571 atlas = SkNEW_ARGS(GrBatchAtlas, (texture, NUM_PLOTS_X, NUM_PLOTS_Y)); 571 atlas = SkNEW_ARGS(GrBatchAtlas, (texture, NUM_PLOTS_X, NUM_PLOTS_Y));
572 } else { 572 } else {
573 return NULL; 573 return NULL;
574 } 574 }
575 atlas->registerEvictionCallback(func, data); 575 atlas->registerEvictionCallback(func, data);
576 return atlas; 576 return atlas;
577 } 577 }
578 578
579 bool GrAADistanceFieldPathRenderer::onDrawPath(GrDrawTarget* target, 579 bool GrAADistanceFieldPathRenderer::onDrawPath(GrDrawTarget* target,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 geometry.fPath = GrTest::TestPath(random); 671 geometry.fPath = GrTest::TestPath(random);
672 geometry.fAntiAlias = random->nextBool(); 672 geometry.fAntiAlias = random->nextBool();
673 673
674 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, 674 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix,
675 gTestStruct.fAtlas, 675 gTestStruct.fAtlas,
676 &gTestStruct.fPathCache, 676 &gTestStruct.fPathCache,
677 &gTestStruct.fPathList); 677 &gTestStruct.fPathList);
678 } 678 }
679 679
680 #endif 680 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698