OLD | NEW |
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 "GrContextPriv.h" | 9 #include "GrContextPriv.h" |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 const SkSurface
Props* surfaceProps, | 741 const SkSurface
Props* surfaceProps, |
742 SkBudgeted budg
eted) { | 742 SkBudgeted budg
eted) { |
743 if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) { | 743 if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) { |
744 config = GrPixelConfigFallback(config); | 744 config = GrPixelConfigFallback(config); |
745 } | 745 } |
746 | 746 |
747 return this->makeRenderTargetContext(fit, width, height, config, std::move(c
olorSpace), | 747 return this->makeRenderTargetContext(fit, width, height, config, std::move(c
olorSpace), |
748 sampleCnt, origin, surfaceProps, budget
ed); | 748 sampleCnt, origin, surfaceProps, budget
ed); |
749 } | 749 } |
750 | 750 |
| 751 sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContextWithFallb
ack( |
| 752 SkBackingFit fi
t, |
| 753 int width, int
height, |
| 754 GrPixelConfig c
onfig, |
| 755 sk_sp<SkColorSp
ace> colorSpace, |
| 756 int sampleCnt, |
| 757 GrSurfaceOrigin
origin, |
| 758 const SkSurface
Props* surfaceProps, |
| 759 SkBudgeted budg
eted) { |
| 760 if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) { |
| 761 config = GrPixelConfigFallback(config); |
| 762 } |
| 763 |
| 764 return this->makeDeferredRenderTargetContext(fit, width, height, config, std
::move(colorSpace), |
| 765 sampleCnt, origin, surfaceProps
, budgeted); |
| 766 } |
| 767 |
751 sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContext(SkBackingFit fit
, | 768 sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContext(SkBackingFit fit
, |
752 int width, int h
eight, | 769 int width, int h
eight, |
753 GrPixelConfig co
nfig, | 770 GrPixelConfig co
nfig, |
754 sk_sp<SkColorSpa
ce> colorSpace, | 771 sk_sp<SkColorSpa
ce> colorSpace, |
755 int sampleCnt, | 772 int sampleCnt, |
756 GrSurfaceOrigin
origin, | 773 GrSurfaceOrigin
origin, |
757 const SkSurfaceP
rops* surfaceProps, | 774 const SkSurfaceP
rops* surfaceProps, |
758 SkBudgeted budge
ted) { | 775 SkBudgeted budge
ted) { |
759 if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) { | 776 if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) { |
760 return nullptr; | 777 return nullptr; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 ASSERT_SINGLE_OWNER | 909 ASSERT_SINGLE_OWNER |
893 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 910 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
894 } | 911 } |
895 | 912 |
896 ////////////////////////////////////////////////////////////////////////////// | 913 ////////////////////////////////////////////////////////////////////////////// |
897 | 914 |
898 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 915 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
899 ASSERT_SINGLE_OWNER | 916 ASSERT_SINGLE_OWNER |
900 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 917 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
901 } | 918 } |
OLD | NEW |