| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 success = this->uploadTexDataOptimal(vkTex, left, top, width, height
, config, texels); | 361 success = this->uploadTexDataOptimal(vkTex, left, top, width, height
, config, texels); |
| 362 } | 362 } |
| 363 } | 363 } |
| 364 | 364 |
| 365 return success; | 365 return success; |
| 366 } | 366 } |
| 367 | 367 |
| 368 void GrVkGpu::onResolveRenderTarget(GrRenderTarget* target) { | 368 void GrVkGpu::onResolveRenderTarget(GrRenderTarget* target) { |
| 369 if (target->needsResolve()) { | 369 if (target->needsResolve() && target->numColorSamples() > 1) { |
| 370 SkASSERT(target->numColorSamples() > 1); | |
| 371 | |
| 372 GrVkRenderTarget* rt = static_cast<GrVkRenderTarget*>(target); | 370 GrVkRenderTarget* rt = static_cast<GrVkRenderTarget*>(target); |
| 373 SkASSERT(rt->msaaImage()); | 371 SkASSERT(rt->msaaImage()); |
| 374 | 372 |
| 375 // Flip rect if necessary | 373 // Flip rect if necessary |
| 376 SkIRect srcVkRect = rt->getResolveRect(); | 374 SkIRect srcVkRect = rt->getResolveRect(); |
| 377 | 375 |
| 378 if (kBottomLeft_GrSurfaceOrigin == rt->origin()) { | 376 if (kBottomLeft_GrSurfaceOrigin == rt->origin()) { |
| 379 srcVkRect.fTop = rt->height() - rt->getResolveRect().fBottom; | 377 srcVkRect.fTop = rt->height() - rt->getResolveRect().fBottom; |
| 380 srcVkRect.fBottom = rt->height() - rt->getResolveRect().fTop; | 378 srcVkRect.fBottom = rt->height() - rt->getResolveRect().fTop; |
| 381 } | 379 } |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 } | 1602 } |
| 1605 | 1603 |
| 1606 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment | 1604 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment |
| 1607 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment | 1605 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment |
| 1608 // which is always at the first attachment. | 1606 // which is always at the first attachment. |
| 1609 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); | 1607 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); |
| 1610 fCurrentCmdBuffer->executeCommands(this, buffer); | 1608 fCurrentCmdBuffer->executeCommands(this, buffer); |
| 1611 fCurrentCmdBuffer->endRenderPass(this); | 1609 fCurrentCmdBuffer->endRenderPass(this); |
| 1612 } | 1610 } |
| 1613 | 1611 |
| OLD | NEW |