diff options
author | robertphillips <robertphillips@google.com> | 2014-06-29 17:16:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-29 17:16:27 -0700 |
commit | e462f2bed33283862bb983c67776a47c5a6acb01 (patch) | |
tree | e7aa3ecfa6e9d211461a0be6624b4f3cf42de55b /src/gpu/GrAtlas.cpp | |
parent | d9cf38aeaf64a23c26f3927f97c33e14fbefad35 (diff) |
Revert of Begin atlasing (https://codereview.chromium.org/354533004/)
Reason for revert:
Sigh
Original issue's description:
> Begin atlasing
>
> This CL makes it possible for pulled-forward-layers to be atlased. It currently has a couple glaring limitations (which is why it is disabled):
>
> 1) the atlased layers cannot be purged nor aged out
> 2) the texture backing the atlas is not pulled from (or returned to) the resource cache
>
> #1 is on hold until we have a recycling rectanizer
>
> A separate major limitation (the non-atlased layers aren't cached) is blocked until we can transmute entries in the resource cache from scratch to non-scratch while potentially preserving their contents.
>
> Committed: https://skia.googlesource.com/skia/+/55e61f0ef4e5c8c34ac107deaadc9b4ffef3111b
R=bsalomon@google.com
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/359953002
Diffstat (limited to 'src/gpu/GrAtlas.cpp')
-rw-r--r-- | src/gpu/GrAtlas.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp index 1bff42a82f..30b4bac139 100644 --- a/src/gpu/GrAtlas.cpp +++ b/src/gpu/GrAtlas.cpp @@ -54,7 +54,8 @@ static inline void adjust_for_offset(SkIPoint16* loc, const SkIPoint16& offset) loc->fY += offset.fY; } -bool GrPlot::addSubImage(int width, int height, const void* image, SkIPoint16* loc) { +bool GrPlot::addSubImage(int width, int height, const void* image, + SkIPoint16* loc) { float percentFull = fRects->percentFull(); if (!fRects->addRect(width, height, loc)) { return false; @@ -87,7 +88,7 @@ bool GrPlot::addSubImage(int width, int height, const void* image, SkIPoint16* l adjust_for_offset(loc, fOffset); fDirty = true; // otherwise, just upload the image directly - } else if (NULL != image) { + } else { adjust_for_offset(loc, fOffset); GrContext* context = fTexture->getContext(); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "GrPlot::uploadToTexture"); @@ -95,8 +96,6 @@ bool GrPlot::addSubImage(int width, int height, const void* image, SkIPoint16* l loc->fX, loc->fY, width, height, fTexture->config(), image, 0, GrContext::kDontFlush_PixelOpsFlag); - } else { - adjust_for_offset(loc, fOffset); } #if FONT_CACHE_STATS @@ -147,12 +146,11 @@ void GrPlot::resetRects() { /////////////////////////////////////////////////////////////////////////////// -GrAtlas::GrAtlas(GrGpu* gpu, GrPixelConfig config, GrTextureFlags flags, +GrAtlas::GrAtlas(GrGpu* gpu, GrPixelConfig config, const SkISize& backingTextureSize, int numPlotsX, int numPlotsY, bool batchUploads) { fGpu = SkRef(gpu); fPixelConfig = config; - fFlags = flags; fBackingTextureSize = backingTextureSize; fNumPlotsX = numPlotsX; fNumPlotsY = numPlotsY; @@ -223,7 +221,7 @@ GrPlot* GrAtlas::addToAtlas(ClientPlotUsage* usage, if (NULL == fTexture) { // TODO: Update this to use the cache rather than directly creating a texture. GrTextureDesc desc; - desc.fFlags = fFlags | kDynamicUpdate_GrTextureFlagBit; + desc.fFlags = kDynamicUpdate_GrTextureFlagBit; desc.fWidth = fBackingTextureSize.width(); desc.fHeight = fBackingTextureSize.height(); desc.fConfig = fPixelConfig; |