aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-05-11 10:14:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-11 14:47:27 +0000
commitc7fe0f708ccbf12bf2ad1374ff307940d2c93880 (patch)
treecc4e63c994ac6af6ddab2f0fa063dbf800e2dd8a /tools
parent244f754cdd6ba1c5917a65cd94fe0bf87e3a7339 (diff)
Make GrCaps and GrShaderCaps private.
Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps(). Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866 Reviewed-on: https://skia-review.googlesource.com/127389 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/gpu/GrContextFactory.cpp5
-rw-r--r--tools/sk_app/GLWindowContext.cpp16
-rw-r--r--tools/skiaserve/Request.cpp2
-rw-r--r--tools/skpbench/skpbench.cpp34
-rw-r--r--tools/viewer/Viewer.cpp31
5 files changed, 44 insertions, 44 deletions
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index 3692606247..2bfccd9763 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -7,6 +7,7 @@
*/
#include "GrContextFactory.h"
+#include "GrContextPriv.h"
#include "gl/GLTestContext.h"
#if SK_ANGLE
@@ -275,12 +276,12 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
return ContextInfo();
}
if (ContextOverrides::kRequireNVPRSupport & overrides) {
- if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) {
+ if (!grCtx->contextPriv().caps()->shaderCaps()->pathRenderingSupport()) {
return ContextInfo();
}
}
if (ContextOverrides::kRequireSRGBSupport & overrides) {
- if (!grCtx->caps()->srgbSupport()) {
+ if (!grCtx->contextPriv().caps()->srgbSupport()) {
return ContextInfo();
}
}
diff --git a/tools/sk_app/GLWindowContext.cpp b/tools/sk_app/GLWindowContext.cpp
index 7dddede9aa..b6a8df9105 100644
--- a/tools/sk_app/GLWindowContext.cpp
+++ b/tools/sk_app/GLWindowContext.cpp
@@ -6,17 +6,17 @@
* found in the LICENSE file.
*/
+#include "GLWindowContext.h"
#include "GrBackendSurface.h"
+#include "GrCaps.h"
#include "GrContext.h"
-#include "GLWindowContext.h"
-
-#include "gl/GrGLDefines.h"
-#include "gl/GrGLUtil.h"
-
+#include "GrContextPriv.h"
#include "SkCanvas.h"
#include "SkImage_Base.h"
#include "SkMathPriv.h"
#include "SkSurface.h"
+#include "gl/GrGLDefines.h"
+#include "gl/GrGLUtil.h"
namespace sk_app {
@@ -61,8 +61,10 @@ sk_sp<SkSurface> GLWindowContext::getBackbufferSurface() {
GR_GL_CALL(fBackendContext.get(), GetIntegerv(GR_GL_FRAMEBUFFER_BINDING,
&buffer));
fbInfo.fFBOID = buffer;
- fbInfo.fFormat = fContext->caps()->srgbSupport() && fDisplayParams.fColorSpace
- ? GR_GL_SRGB8_ALPHA8 : GR_GL_RGBA8;
+ fbInfo.fFormat =
+ fContext->contextPriv().caps()->srgbSupport() && fDisplayParams.fColorSpace
+ ? GR_GL_SRGB8_ALPHA8
+ : GR_GL_RGBA8;
GrBackendRenderTarget backendRT(fWidth,
fHeight,
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 6081c05c74..7808638c3b 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -136,7 +136,7 @@ SkIRect Request::getBounds() {
bounds = fPicture->cullRect().roundOut();
if (fGPUEnabled) {
#if SK_SUPPORT_GPU
- int maxRTSize = this->getContext()->caps()->maxRenderTargetSize();
+ int maxRTSize = this->getContext()->maxRenderTargetSize();
bounds = SkIRect::MakeWH(SkTMin(bounds.width(), maxRTSize),
SkTMin(bounds.height(), maxRTSize));
#endif
diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp
index 92a642af1c..452095fe06 100644
--- a/tools/skpbench/skpbench.cpp
+++ b/tools/skpbench/skpbench.cpp
@@ -5,13 +5,20 @@
* found in the LICENSE file.
*/
+#include <stdlib.h>
+#include <algorithm>
+#include <array>
+#include <chrono>
+#include <cmath>
+#include <vector>
#include "GpuTimer.h"
+#include "GrCaps.h"
#include "GrContextFactory.h"
-#include "SkGr.h"
-
+#include "GrContextPriv.h"
#include "SkCanvas.h"
#include "SkCommonFlags.h"
#include "SkCommonFlagsGpu.h"
+#include "SkGr.h"
#include "SkOSFile.h"
#include "SkOSPath.h"
#include "SkPerlinNoiseShader.h"
@@ -20,16 +27,10 @@
#include "SkStream.h"
#include "SkSurface.h"
#include "SkSurfaceProps.h"
-#include "picture_utils.h"
-#include "sk_tool_utils.h"
#include "flags/SkCommandLineFlags.h"
#include "flags/SkCommonFlagsConfig.h"
-#include <stdlib.h>
-#include <algorithm>
-#include <array>
-#include <chrono>
-#include <cmath>
-#include <vector>
+#include "picture_utils.h"
+#include "sk_tool_utils.h"
/**
* This is a minimalist program whose sole purpose is to open an skp file, benchmark it on a single
@@ -290,19 +291,18 @@ int main(int argc, char** argv) {
exitf(ExitErr::kUnavailable, "failed to create context for config %s",
config->getTag().c_str());
}
- if (ctx->caps()->maxRenderTargetSize() < SkTMax(width, height)) {
+ if (ctx->maxRenderTargetSize() < SkTMax(width, height)) {
exitf(ExitErr::kUnavailable, "render target size %ix%i not supported by platform (max: %i)",
- width, height, ctx->caps()->maxRenderTargetSize());
+ width, height, ctx->maxRenderTargetSize());
}
- GrPixelConfig grPixConfig = SkImageInfo2GrPixelConfig(config->getColorType(),
- config->getColorSpace(),
- *ctx->caps());
+ GrPixelConfig grPixConfig = SkImageInfo2GrPixelConfig(
+ config->getColorType(), config->getColorSpace(), *ctx->contextPriv().caps());
if (kUnknown_GrPixelConfig == grPixConfig) {
exitf(ExitErr::kUnavailable, "failed to get GrPixelConfig from SkColorType: %d",
config->getColorType());
}
- int supportedSampleCount =
- ctx->caps()->getRenderTargetSampleCount(config->getSamples(), grPixConfig);
+ int supportedSampleCount = ctx->contextPriv().caps()->getRenderTargetSampleCount(
+ config->getSamples(), grPixConfig);
if (supportedSampleCount != config->getSamples()) {
exitf(ExitErr::kUnavailable, "sample count %i not supported by platform",
config->getSamples());
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 185868266f..cfb8c61add 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -6,22 +6,21 @@
*/
#include "Viewer.h"
-
+#include <stdlib.h>
+#include <map>
#include "BisectSlide.h"
#include "GMSlide.h"
+#include "GrContext.h"
+#include "GrContextPriv.h"
#include "ImageSlide.h"
#include "Resources.h"
-#include "SampleSlide.h"
#include "SKPSlide.h"
-#include "SlideDir.h"
-#include "SvgSlide.h"
-
-#include "GrContext.h"
+#include "SampleSlide.h"
#include "SkCanvas.h"
#include "SkColorSpacePriv.h"
#include "SkColorSpaceXformCanvas.h"
-#include "SkCommonFlags.h"
#include "SkCommandLineFlags.h"
+#include "SkCommonFlags.h"
#include "SkCommonFlagsGpu.h"
#include "SkEventTracingPriv.h"
#include "SkFontMgrPriv.h"
@@ -38,13 +37,10 @@
#include "SkTaskGroup.h"
#include "SkTestFontMgr.h"
#include "SkThreadedBMPDevice.h"
-
-#include "imgui.h"
-
+#include "SlideDir.h"
+#include "SvgSlide.h"
#include "ccpr/GrCoverageCountingPathRenderer.h"
-
-#include <stdlib.h>
-#include <map>
+#include "imgui.h"
#if defined(SK_ENABLE_SKOTTIE)
#include "SkottieSlide.h"
@@ -1479,7 +1475,7 @@ void Viewer::drawImGui() {
} else if (fWindow->sampleCount() > 1) {
prButton(GpuPathRenderers::kDefault);
prButton(GpuPathRenderers::kAll);
- if (ctx->caps()->shaderCaps()->pathRenderingSupport()) {
+ if (ctx->contextPriv().caps()->shaderCaps()->pathRenderingSupport()) {
prButton(GpuPathRenderers::kStencilAndCover);
}
prButton(GpuPathRenderers::kTessellating);
@@ -1487,7 +1483,8 @@ void Viewer::drawImGui() {
} else {
prButton(GpuPathRenderers::kDefault);
prButton(GpuPathRenderers::kAll);
- if (GrCoverageCountingPathRenderer::IsSupported(*ctx->caps())) {
+ if (GrCoverageCountingPathRenderer::IsSupported(
+ *ctx->contextPriv().caps())) {
prButton(GpuPathRenderers::kCoverageCounting);
}
prButton(GpuPathRenderers::kSmall);
@@ -1852,7 +1849,7 @@ void Viewer::updateUIState() {
} else if (fWindow->sampleCount() > 1) {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kDefault]);
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kAll]);
- if (ctx->caps()->shaderCaps()->pathRenderingSupport()) {
+ if (ctx->contextPriv().caps()->shaderCaps()->pathRenderingSupport()) {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kStencilAndCover]);
}
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kTessellating]);
@@ -1860,7 +1857,7 @@ void Viewer::updateUIState() {
} else {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kDefault]);
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kAll]);
- if (GrCoverageCountingPathRenderer::IsSupported(*ctx->caps())) {
+ if (GrCoverageCountingPathRenderer::IsSupported(*ctx->contextPriv().caps())) {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kCoverageCounting]);
}
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kSmall]);