| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrVkGpu.h" | 8 #include "GrVkGpu.h" |
| 9 | 9 |
| 10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
| (...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 transferBuffer->unref(); | 1480 transferBuffer->unref(); |
| 1481 | 1481 |
| 1482 return true; | 1482 return true; |
| 1483 } | 1483 } |
| 1484 | 1484 |
| 1485 void GrVkGpu::submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer* buf
fer, | 1485 void GrVkGpu::submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer* buf
fer, |
| 1486 const GrVkRenderPass* renderPass, | 1486 const GrVkRenderPass* renderPass, |
| 1487 const VkClearValue* colorClear, | 1487 const VkClearValue* colorClear, |
| 1488 GrVkRenderTarget* target, | 1488 GrVkRenderTarget* target, |
| 1489 const SkIRect& bounds) { | 1489 const SkIRect& bounds) { |
| 1490 const SkIRect* pBounds = &bounds; |
| 1491 SkIRect flippedBounds; |
| 1492 if (kBottomLeft_GrSurfaceOrigin == target->origin()) { |
| 1493 flippedBounds = bounds; |
| 1494 flippedBounds.fTop = target->height() - bounds.fBottom; |
| 1495 flippedBounds.fBottom = target->height() - bounds.fTop; |
| 1496 pBounds = &flippedBounds; |
| 1497 } |
| 1498 |
| 1490 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment | 1499 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment |
| 1491 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment | 1500 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment |
| 1492 // which is always at the first attachment. | 1501 // which is always at the first attachment. |
| 1493 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
bounds, true); | 1502 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); |
| 1494 fCurrentCmdBuffer->executeCommands(this, buffer); | 1503 fCurrentCmdBuffer->executeCommands(this, buffer); |
| 1495 fCurrentCmdBuffer->endRenderPass(this); | 1504 fCurrentCmdBuffer->endRenderPass(this); |
| 1496 } | 1505 } |
| 1497 | 1506 |
| OLD | NEW |