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/GrContext.cpp

Issue 1930013002: (Mostly) Retract GrRenderTarget from SkGpuDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 4 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/core/SkSpecialSurface.cpp ('k') | src/gpu/SkGpuDevice.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 2011 Google Inc. 2 * Copyright 2011 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 "GrContext.h" 8 #include "GrContext.h"
9 #include "GrContextOptions.h" 9 #include "GrContextOptions.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 const SkSurfaceProps* surfaceProps) { 649 const SkSurfaceProps* surfaceProps) {
650 ASSERT_SINGLE_OWNER 650 ASSERT_SINGLE_OWNER
651 return fDrawingManager->drawContext(std::move(rt), surfaceProps); 651 return fDrawingManager->drawContext(std::move(rt), surfaceProps);
652 } 652 }
653 653
654 sk_sp<GrDrawContext> GrContext::newDrawContext(SkBackingFit fit, 654 sk_sp<GrDrawContext> GrContext::newDrawContext(SkBackingFit fit,
655 int width, int height, 655 int width, int height,
656 GrPixelConfig config, 656 GrPixelConfig config,
657 int sampleCnt, 657 int sampleCnt,
658 GrSurfaceOrigin origin, 658 GrSurfaceOrigin origin,
659 const SkSurfaceProps* surfaceProp s) { 659 const SkSurfaceProps* surfaceProp s,
660 SkBudgeted budgeted) {
660 GrSurfaceDesc desc; 661 GrSurfaceDesc desc;
661 desc.fFlags = kRenderTarget_GrSurfaceFlag; 662 desc.fFlags = kRenderTarget_GrSurfaceFlag;
662 desc.fOrigin = origin; 663 desc.fOrigin = origin;
663 desc.fWidth = width; 664 desc.fWidth = width;
664 desc.fHeight = height; 665 desc.fHeight = height;
665 desc.fConfig = config; 666 desc.fConfig = config;
666 desc.fSampleCnt = sampleCnt; 667 desc.fSampleCnt = sampleCnt;
667 668
668 sk_sp<GrTexture> tex; 669 sk_sp<GrTexture> tex;
669 if (SkBackingFit::kExact == fit) { 670 if (SkBackingFit::kExact == fit) {
670 tex.reset(this->textureProvider()->createTexture(desc, SkBudgeted::kYes) ); 671 tex.reset(this->textureProvider()->createTexture(desc, budgeted));
671 } else { 672 } else {
672 tex.reset(this->textureProvider()->createApproxTexture(desc)); 673 tex.reset(this->textureProvider()->createApproxTexture(desc));
673 } 674 }
674 if (!tex) { 675 if (!tex) {
675 return nullptr; 676 return nullptr;
676 } 677 }
677 678
678 sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(tex->asRenderTa rget()), 679 sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(tex->asRenderTa rget()),
679 surfaceProps)); 680 surfaceProps));
680 if (!drawContext) { 681 if (!drawContext) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 ASSERT_SINGLE_OWNER 765 ASSERT_SINGLE_OWNER
765 fResourceCache->setLimits(maxTextures, maxTextureBytes); 766 fResourceCache->setLimits(maxTextures, maxTextureBytes);
766 } 767 }
767 768
768 ////////////////////////////////////////////////////////////////////////////// 769 //////////////////////////////////////////////////////////////////////////////
769 770
770 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 771 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
771 ASSERT_SINGLE_OWNER 772 ASSERT_SINGLE_OWNER
772 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 773 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
773 } 774 }
OLDNEW
« no previous file with comments | « src/core/SkSpecialSurface.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698