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 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 | 1381 |
1382 bool GrVkGpu::onGetReadPixelsInfo(GrSurface* srcSurface, int width, int height,
size_t rowBytes, | 1382 bool GrVkGpu::onGetReadPixelsInfo(GrSurface* srcSurface, int width, int height,
size_t rowBytes, |
1383 GrPixelConfig readConfig, DrawPreference* draw
Preference, | 1383 GrPixelConfig readConfig, DrawPreference* draw
Preference, |
1384 ReadPixelTempDrawInfo* tempDrawInfo) { | 1384 ReadPixelTempDrawInfo* tempDrawInfo) { |
1385 // These settings we will always want if a temp draw is performed. | 1385 // These settings we will always want if a temp draw is performed. |
1386 tempDrawInfo->fTempSurfaceDesc.fFlags = kRenderTarget_GrSurfaceFlag; | 1386 tempDrawInfo->fTempSurfaceDesc.fFlags = kRenderTarget_GrSurfaceFlag; |
1387 tempDrawInfo->fTempSurfaceDesc.fWidth = width; | 1387 tempDrawInfo->fTempSurfaceDesc.fWidth = width; |
1388 tempDrawInfo->fTempSurfaceDesc.fHeight = height; | 1388 tempDrawInfo->fTempSurfaceDesc.fHeight = height; |
1389 tempDrawInfo->fTempSurfaceDesc.fSampleCnt = 0; | 1389 tempDrawInfo->fTempSurfaceDesc.fSampleCnt = 0; |
1390 tempDrawInfo->fTempSurfaceDesc.fOrigin = kTopLeft_GrSurfaceOrigin; // no CPU
y-flip for TL. | 1390 tempDrawInfo->fTempSurfaceDesc.fOrigin = kTopLeft_GrSurfaceOrigin; // no CPU
y-flip for TL. |
1391 tempDrawInfo->fUseExactScratch = false; | 1391 tempDrawInfo->fTempSurfaceFit = SkBackingFit::kApprox; |
1392 | 1392 |
1393 // For now assume no swizzling, we may change that below. | 1393 // For now assume no swizzling, we may change that below. |
1394 tempDrawInfo->fSwizzle = GrSwizzle::RGBA(); | 1394 tempDrawInfo->fSwizzle = GrSwizzle::RGBA(); |
1395 | 1395 |
1396 // Depends on why we need/want a temp draw. Start off assuming no change, th
e surface we read | 1396 // Depends on why we need/want a temp draw. Start off assuming no change, th
e surface we read |
1397 // from will be srcConfig and we will read readConfig pixels from it. | 1397 // from will be srcConfig and we will read readConfig pixels from it. |
1398 // Not that if we require a draw and return a non-renderable format for the
temp surface the | 1398 // Not that if we require a draw and return a non-renderable format for the
temp surface the |
1399 // base class will fail for us. | 1399 // base class will fail for us. |
1400 tempDrawInfo->fTempSurfaceDesc.fConfig = srcSurface->config(); | 1400 tempDrawInfo->fTempSurfaceDesc.fConfig = srcSurface->config(); |
1401 tempDrawInfo->fReadConfig = readConfig; | 1401 tempDrawInfo->fReadConfig = readConfig; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 } | 1562 } |
1563 | 1563 |
1564 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment | 1564 // Currently it is fine for us to always pass in 1 for the clear count even
if no attachment |
1565 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment | 1565 // uses it. In the current state, we also only use the LOAD_OP_CLEAR for the
color attachment |
1566 // which is always at the first attachment. | 1566 // which is always at the first attachment. |
1567 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); | 1567 fCurrentCmdBuffer->beginRenderPass(this, renderPass, 1, colorClear, *target,
*pBounds, true); |
1568 fCurrentCmdBuffer->executeCommands(this, buffer); | 1568 fCurrentCmdBuffer->executeCommands(this, buffer); |
1569 fCurrentCmdBuffer->endRenderPass(this); | 1569 fCurrentCmdBuffer->endRenderPass(this); |
1570 } | 1570 } |
1571 | 1571 |
OLD | NEW |