Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/gpu/vk/GrVkGpuCommandBuffer.cpp

Issue 2289363005: Improve usage of window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_drawsinreducedclip
Patch Set: Improve usage of window rectangles Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 "GrVkGpuCommandBuffer.h" 8 #include "GrVkGpuCommandBuffer.h"
9 9
10 #include "GrFixedClip.h" 10 #include "GrFixedClip.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 SkASSERT(fRenderPass->isCompatible(*oldRP)); 164 SkASSERT(fRenderPass->isCompatible(*oldRP));
165 oldRP->unref(fGpu); 165 oldRP->unref(fGpu);
166 } 166 }
167 } 167 }
168 168
169 void GrVkGpuCommandBuffer::onClearStencilClip(GrRenderTarget* target, 169 void GrVkGpuCommandBuffer::onClearStencilClip(GrRenderTarget* target,
170 const GrFixedClip& clip, 170 const GrFixedClip& clip,
171 bool insideStencilMask) { 171 bool insideStencilMask) {
172 SkASSERT(target); 172 SkASSERT(target);
173 SkASSERT(clip.windowRectangles().disabled());
173 174
174 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(target); 175 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(target);
175 GrStencilAttachment* sb = target->renderTargetPriv().getStencilAttachment(); 176 GrStencilAttachment* sb = target->renderTargetPriv().getStencilAttachment();
176 // this should only be called internally when we know we have a 177 // this should only be called internally when we know we have a
177 // stencil buffer. 178 // stencil buffer.
178 SkASSERT(sb); 179 SkASSERT(sb);
179 int stencilBitCount = sb->bits(); 180 int stencilBitCount = sb->bits();
180 181
181 // The contract with the callers does not guarantee that we preserve all bit s in the stencil 182 // The contract with the callers does not guarantee that we preserve all bit s in the stencil
182 // during this clear. Thus we will clear the entire stencil to the desired v alue. 183 // during this clear. Thus we will clear the entire stencil to the desired v alue.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 attachment.colorAttachment = 0; // this value shouldn't matter 217 attachment.colorAttachment = 0; // this value shouldn't matter
217 attachment.clearValue.depthStencil = vkStencilColor; 218 attachment.clearValue.depthStencil = vkStencilColor;
218 219
219 fCommandBuffer->clearAttachments(fGpu, 1, &attachment, 1, &clearRect); 220 fCommandBuffer->clearAttachments(fGpu, 1, &attachment, 1, &clearRect);
220 fIsEmpty = false; 221 fIsEmpty = false;
221 } 222 }
222 223
223 void GrVkGpuCommandBuffer::onClear(GrRenderTarget* target, const GrFixedClip& cl ip, GrColor color) { 224 void GrVkGpuCommandBuffer::onClear(GrRenderTarget* target, const GrFixedClip& cl ip, GrColor color) {
224 // parent class should never let us get here with no RT 225 // parent class should never let us get here with no RT
225 SkASSERT(target); 226 SkASSERT(target);
227 SkASSERT(clip.windowRectangles().disabled());
226 228
227 VkClearColorValue vkColor; 229 VkClearColorValue vkColor;
228 GrColorToRGBAFloat(color, vkColor.float32); 230 GrColorToRGBAFloat(color, vkColor.float32);
229 231
230 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(target); 232 GrVkRenderTarget* vkRT = static_cast<GrVkRenderTarget*>(target);
231 233
232 if (fIsEmpty && !clip.scissorEnabled()) { 234 if (fIsEmpty && !clip.scissorEnabled()) {
233 // We will change the render pass to do a clear load instead 235 // We will change the render pass to do a clear load instead
234 GrVkRenderPass::LoadStoreOps vkColorOps(VK_ATTACHMENT_LOAD_OP_CLEAR, 236 GrVkRenderPass::LoadStoreOps vkColorOps(VK_ATTACHMENT_LOAD_OP_CLEAR,
235 VK_ATTACHMENT_STORE_OP_STORE); 237 VK_ATTACHMENT_STORE_OP_STORE);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 fGpu->stats()->incNumDraws(); 444 fGpu->stats()->incNumDraws();
443 } while ((nonIdxMesh = iter.next())); 445 } while ((nonIdxMesh = iter.next()));
444 } 446 }
445 447
446 // Technically we don't have to call this here (since there is a safety chec k in 448 // Technically we don't have to call this here (since there is a safety chec k in
447 // pipelineState:setData but this will allow for quicker freeing of resource s if the 449 // pipelineState:setData but this will allow for quicker freeing of resource s if the
448 // pipelineState sits in a cache for a while. 450 // pipelineState sits in a cache for a while.
449 pipelineState->freeTempResources(fGpu); 451 pipelineState->freeTempResources(fGpu);
450 } 452 }
451 453
OLDNEW
« src/gpu/GrFixedClip.h ('K') | « src/gpu/gl/GrGLGpu.cpp ('k') | tests/ProxyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698