Replace most uses of GrSurface::desc() with conifg(), width(), etc.
authorBrian Salomon <bsalomon@google.com>
Wed, 17 May 2017 14:40:02 +0000 (10:40 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 17 May 2017 18:56:50 +0000 (18:56 +0000)
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>

include/gpu/GrSurface.h
src/gpu/GrGpu.cpp
src/gpu/gl/GrGLGpu.cpp
src/gpu/vk/GrVkGpu.cpp
tools/gpu/GrTest.cpp

index 668838b..b6d1c50 100644 (file)
@@ -50,7 +50,7 @@ public:
     GrPixelConfig config() const { return fDesc.fConfig; }
 
     /**
-     * Return the descriptor describing the surface
+     * Return the descriptor describing the surface.
      */
     const GrSurfaceDesc& desc() const { return fDesc; }
 
index ceb0dee..0f7645a 100644 (file)
@@ -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()) {
index 842e229..d77ca71 100644 (file)
@@ -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);
index e6a69b7..8469755 100644 (file)
@@ -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,
index b8bf681..af1a06f 100644 (file)
@@ -331,7 +331,7 @@ public:
 
     void onQueryMultisampleSpecs(GrRenderTarget* rt, const GrStencilSettings&,
                                  int* effectiveSampleCnt, SamplePattern*) override {
-        *effectiveSampleCnt = rt->desc().fSampleCnt;
+        *effectiveSampleCnt = rt->numStencilSamples();
     }
 
     GrGpuCommandBuffer* createCommandBuffer(const GrGpuCommandBuffer::LoadAndStoreInfo&,