diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-13 17:58:13 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-13 17:58:13 +0000 |
commit | 919583674bd5daeb60327c0bc1ce8aaa80d54e13 (patch) | |
tree | 9f1995df1f0cb6eff01c94445e96e60fcd32e59b /src/gpu | |
parent | e32b5837c3f35b80502759f3de3e8cadf6625f4e (diff) |
Consider hw render target limit for offscreen supersample and tile
Review URL: http://codereview.appspot.com/4575041/
git-svn-id: http://skia.googlecode.com/svn/trunk@1568 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index ae8ab6c842..d1cb5b9a10 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -914,9 +914,9 @@ void SkGpuDevice::drawBitmap(const SkDraw& draw, sampler->setFilter(GrSamplerState::kNearest_Filter); } - const int maxTextureDim = fContext->getMaxTextureDimension(); - if (bitmap.getTexture() || (bitmap.width() <= maxTextureDim && - bitmap.height() <= maxTextureDim)) { + const int maxTextureSize = fContext->getMaxTextureSize(); + if (bitmap.getTexture() || (bitmap.width() <= maxTextureSize && + bitmap.height() <= maxTextureSize)) { // take the fast case this->internalDrawBitmap(draw, bitmap, srcRect, m, &grPaint); return; @@ -941,13 +941,13 @@ void SkGpuDevice::drawBitmap(const SkDraw& draw, clipRect.offset(DX, DY); } - int nx = bitmap.width() / maxTextureDim; - int ny = bitmap.height() / maxTextureDim; + int nx = bitmap.width() / maxTextureSize; + int ny = bitmap.height() / maxTextureSize; for (int x = 0; x <= nx; x++) { for (int y = 0; y <= ny; y++) { SkIRect tileR; - tileR.set(x * maxTextureDim, y * maxTextureDim, - (x + 1) * maxTextureDim, (y + 1) * maxTextureDim); + tileR.set(x * maxTextureSize, y * maxTextureSize, + (x + 1) * maxTextureSize, (y + 1) * maxTextureSize); if (!SkIRect::Intersects(tileR, clipRect)) { continue; } @@ -986,8 +986,8 @@ void SkGpuDevice::internalDrawBitmap(const SkDraw& draw, const SkIRect& srcRect, const SkMatrix& m, GrPaint* grPaint) { - SkASSERT(bitmap.width() <= fContext->getMaxTextureDimension() && - bitmap.height() <= fContext->getMaxTextureDimension()); + SkASSERT(bitmap.width() <= fContext->getMaxTextureSize() && + bitmap.height() <= fContext->getMaxTextureSize()); SkAutoLockPixels alp(bitmap); if (!bitmap.getTexture() && !bitmap.readyToDraw()) { |