aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-17 10:40:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-17 18:56:50 +0000
commit154ce91dc96187229d0bc84cf10a77f480194e6f (patch)
treea6528cbf005968f723a6add1327df6fce917626b /src/gpu
parent98bff776d3cd1b077783e41092c3f1091d8c1519 (diff)
Replace most uses of GrSurface::desc() with conifg(), width(), etc.
Change-Id: Ic283c0ddf9efa0a467e97e10f5413ba9dfcb414f Reviewed-on: https://skia-review.googlesource.com/17211 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrGpu.cpp7
-rw-r--r--src/gpu/gl/GrGLGpu.cpp8
-rw-r--r--src/gpu/vk/GrVkGpu.cpp6
3 files changed, 10 insertions, 11 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index ceb0dee78e..0f7645a25c 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -311,8 +311,7 @@ bool GrGpu::getWritePixelsInfo(GrSurface* dstSurface, int width, int height,
SkASSERT(dstSurface);
SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference);
- if (GrPixelConfigIsCompressed(dstSurface->desc().fConfig) &&
- dstSurface->desc().fConfig != srcConfig) {
+ if (GrPixelConfigIsCompressed(dstSurface->config()) && dstSurface->config() != srcConfig) {
return false;
}
@@ -464,7 +463,7 @@ void GrGpu::didWriteToSurface(GrSurface* surface, const SkIRect* bounds, uint32_
const GrGpu::MultisampleSpecs& GrGpu::queryMultisampleSpecs(const GrPipeline& pipeline) {
GrRenderTarget* rt = pipeline.getRenderTarget();
- SkASSERT(rt->desc().fSampleCnt > 1);
+ SkASSERT(rt->numStencilSamples() > 1);
GrStencilSettings stencil;
if (pipeline.isStencilEnabled()) {
@@ -477,7 +476,7 @@ const GrGpu::MultisampleSpecs& GrGpu::queryMultisampleSpecs(const GrPipeline& pi
int effectiveSampleCnt;
SkSTArray<16, SkPoint, true> pattern;
this->onQueryMultisampleSpecs(rt, stencil, &effectiveSampleCnt, &pattern);
- SkASSERT(effectiveSampleCnt >= rt->desc().fSampleCnt);
+ SkASSERT(effectiveSampleCnt >= rt->numStencilSamples());
uint8_t id;
if (this->caps()->sampleLocationsSupport()) {
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 842e22980b..d77ca71476 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -766,9 +766,9 @@ bool GrGLGpu::onWritePixels(GrSurface* surface,
GL_CALL(BindTexture(glTex->target(), glTex->textureID()));
bool success = false;
- if (GrPixelConfigIsCompressed(glTex->desc().fConfig)) {
+ if (GrPixelConfigIsCompressed(glTex->config())) {
// We check that config == desc.fConfig in GrGLGpu::canWriteTexturePixels()
- SkASSERT(config == glTex->desc().fConfig);
+ SkASSERT(config == glTex->config());
success = this->uploadCompressedTexData(glTex->desc(), glTex->target(), texels,
kWrite_UploadType, left, top, width, height);
} else {
@@ -790,7 +790,7 @@ bool GrGLGpu::onTransferPixels(GrSurface* surface,
}
// For the moment, can't transfer compressed data
- if (GrPixelConfigIsCompressed(glTex->desc().fConfig)) {
+ if (GrPixelConfigIsCompressed(glTex->config())) {
return false;
}
@@ -4271,7 +4271,7 @@ void GrGLGpu::onQueryMultisampleSpecs(GrRenderTarget* rt, const GrStencilSetting
GR_GL_GetIntegerv(this->glInterface(), GR_GL_SAMPLES, effectiveSampleCnt);
}
- SkASSERT(*effectiveSampleCnt >= rt->desc().fSampleCnt);
+ SkASSERT(*effectiveSampleCnt >= rt->numStencilSamples());
if (this->caps()->sampleLocationsSupport()) {
samplePattern->reset(*effectiveSampleCnt);
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index e6a69b727d..8469755492 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -379,9 +379,9 @@ bool GrVkGpu::onWritePixels(GrSurface* surface,
}
bool success = false;
- if (GrPixelConfigIsCompressed(vkTex->desc().fConfig)) {
+ if (GrPixelConfigIsCompressed(vkTex->config())) {
// We check that config == desc.fConfig in GrGpu::getWritePixelsInfo()
- SkASSERT(config == vkTex->desc().fConfig);
+ SkASSERT(config == vkTex->config());
// TODO: add compressed texture support
// delete the following two lines and uncomment the two after that when ready
vkTex->unref();
@@ -1716,7 +1716,7 @@ void GrVkGpu::onQueryMultisampleSpecs(GrRenderTarget* rt, const GrStencilSetting
int* effectiveSampleCnt, SamplePattern*) {
// TODO: stub.
SkASSERT(!this->caps()->sampleLocationsSupport());
- *effectiveSampleCnt = rt->desc().fSampleCnt;
+ *effectiveSampleCnt = rt->numStencilSamples();
}
bool GrVkGpu::onGetReadPixelsInfo(GrSurface* srcSurface, int width, int height, size_t rowBytes,