aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-04-03 17:17:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-04 13:32:01 +0000
commitbe77a02a67145edd7ca12fb203b971bb5f1d75a5 (patch)
tree168447831b458c7f5704f1e68f1959f57a0db0b4 /src/gpu
parentae52cccf8b72fbbbd3c009c60a48744988795ea6 (diff)
Hide GrPixelConfig in SkSurfaceCharacterization
TBR=bsalomon@google.com Change-Id: Ifc38d0ca2b18128d27c187f789461fea62d1edae Reviewed-on: https://skia-review.googlesource.com/117440 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrContext.cpp14
-rw-r--r--src/gpu/GrDrawingManager.cpp4
-rw-r--r--src/gpu/GrPathRendererChain.cpp1
-rw-r--r--src/gpu/GrXferProcessor.cpp3
-rw-r--r--src/gpu/gl/GrGLCaps.h4
5 files changed, 15 insertions, 11 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index ce2dc8c1ae..f401f86a56 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -177,10 +177,6 @@ SkSurfaceCharacterization GrContextThreadSafeProxy::createCharacterization(
return SkSurfaceCharacterization(); // return an invalid characterization
}
- if (!SkSurface_Gpu::Valid(ii)) {
- return SkSurfaceCharacterization(); // return an invalid characterization
- }
-
if (!fCaps->mipMapSupport()) {
isMipMapped = false;
}
@@ -190,6 +186,10 @@ SkSurfaceCharacterization GrContextThreadSafeProxy::createCharacterization(
return SkSurfaceCharacterization(); // return an invalid characterization
}
+ if (!SkSurface_Gpu::Valid(fCaps.get(), config, ii.colorSpace())) {
+ return SkSurfaceCharacterization(); // return an invalid characterization
+ }
+
sampleCnt = fCaps->getRenderTargetSampleCount(sampleCnt, config);
if (!sampleCnt) {
return SkSurfaceCharacterization(); // return an invalid characterization
@@ -207,11 +207,11 @@ SkSurfaceCharacterization GrContextThreadSafeProxy::createCharacterization(
}
return SkSurfaceCharacterization(sk_ref_sp<GrContextThreadSafeProxy>(this),
- cacheMaxResourceBytes,
- origin, ii.width(), ii.height(), config, FSAAType, sampleCnt,
+ cacheMaxResourceBytes, ii,
+ origin, config, FSAAType, sampleCnt,
SkSurfaceCharacterization::Textureable(true),
SkSurfaceCharacterization::MipMapped(isMipMapped),
- ii.refColorSpace(), surfaceProps);
+ surfaceProps);
}
void GrContext::abandonContext() {
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 458929ce80..d0e3cfea74 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -476,7 +476,7 @@ sk_sp<GrRenderTargetContext> GrDrawingManager::makeRenderTargetContext(
// SkSurface catches bad color space usage at creation. This check handles anything that slips
// by, including internal usage.
- if (!SkSurface_Gpu::Valid(fContext, sProxy->config(), colorSpace.get())) {
+ if (!SkSurface_Gpu::Valid(fContext->caps(), sProxy->config(), colorSpace.get())) {
SkDEBUGFAIL("Invalid config and colorspace combination");
return nullptr;
}
@@ -499,7 +499,7 @@ sk_sp<GrTextureContext> GrDrawingManager::makeTextureContext(sk_sp<GrSurfaceProx
// SkSurface catches bad color space usage at creation. This check handles anything that slips
// by, including internal usage.
- if (!SkSurface_Gpu::Valid(fContext, sProxy->config(), colorSpace.get())) {
+ if (!SkSurface_Gpu::Valid(fContext->caps(), sProxy->config(), colorSpace.get())) {
SkDEBUGFAIL("Invalid config and colorspace combination");
return nullptr;
}
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index 1e1d87a828..9a4deb58ce 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -10,7 +10,6 @@
#include "GrCaps.h"
#include "GrShaderCaps.h"
-#include "gl/GrGLCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp
index 8f7377e0b2..341b05a0c5 100644
--- a/src/gpu/GrXferProcessor.cpp
+++ b/src/gpu/GrXferProcessor.cpp
@@ -6,8 +6,9 @@
*/
#include "GrXferProcessor.h"
+
+#include "GrCaps.h"
#include "GrPipeline.h"
-#include "gl/GrGLCaps.h"
GrXferProcessor::GrXferProcessor(ClassID classID)
: INHERITED(classID)
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 19d443cc1c..ede2a17578 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -416,6 +416,10 @@ public:
bool getConfigFromBackendFormat(const GrBackendFormat&, SkColorType,
GrPixelConfig*) const override;
+#if GR_TEST_UTILS
+ GrGLStandard standard() const { return fStandard; }
+#endif
+
private:
enum ExternalFormatUsage {
kTexImage_ExternalFormatUsage,