diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-10-05 19:45:25 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-06 16:04:14 +0000 |
commit | 1265894423f394f7ca60e660168414cfb8fe66b3 (patch) | |
tree | 7342d29b4518af5ea302aa33d26b202faf7f0667 /tests/OnFlushCallbackTest.cpp | |
parent | d9a622438663bfad6750e0252a67dfead9ea94fe (diff) |
Don't execute onFlush op lists until after GPU data is uploaded
Bug: skia:
Change-Id: Ide85e802fd6e6a19412457dbaded3545b962c240
Reviewed-on: https://skia-review.googlesource.com/55562
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'tests/OnFlushCallbackTest.cpp')
-rw-r--r-- | tests/OnFlushCallbackTest.cpp | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp index e47a76bb52..370165121d 100644 --- a/tests/OnFlushCallbackTest.cpp +++ b/tests/OnFlushCallbackTest.cpp @@ -166,16 +166,6 @@ private: } // anonymous namespace -#ifdef SK_DEBUG -#include "SkImageEncoder.h" -#include "sk_tool_utils.h" - -static void save_bm(const SkBitmap& bm, const char name[]) { - bool result = sk_tool_utils::EncodeImageToFile(name, bm, SkEncodedImageFormat::kPNG, 100); - SkASSERT(result); -} -#endif - static constexpr SkRect kEmptyRect = SkRect::MakeEmpty(); namespace { @@ -294,23 +284,6 @@ public: fAtlasDest = atlasDest; } - void saveRTC(sk_sp<GrRenderTargetContext> rtc) { - SkASSERT(!fRTC); - fRTC = rtc; - } - -#ifdef SK_DEBUG - void saveAtlasToDisk() { - SkBitmap readBack; - readBack.allocN32Pixels(fRTC->width(), fRTC->height()); - - bool result = fRTC->readPixels(readBack.info(), - readBack.getPixels(), readBack.rowBytes(), 0, 0); - SkASSERT(result); - save_bm(readBack, "atlas-real.png"); - } -#endif - /* * This callback back creates the atlas and updates the AtlasedRectOps to read from it */ @@ -389,9 +362,6 @@ public: this->clearOpsFor(lists[i]); } - // Hide a ref to the RTC in AtlasData so we can check on it later - this->saveRTC(rtc); - results->push_back(std::move(rtc)); } @@ -420,9 +390,6 @@ private: // Each opList containing AtlasedRectOps gets its own internal singly-linked list SkTDArray<LinkedListHeader> fOps; - // The RTC used to create the atlas - sk_sp<GrRenderTargetContext> fRTC; - // For the time being we need to pre-allocate the atlas bc the TextureSamplers require // a GrTexture sk_sp<GrTextureProxy> fAtlasDest; @@ -467,7 +434,14 @@ static sk_sp<GrTextureProxy> make_upstream_image(GrContext* context, AtlasObject // Enable this if you want to debug the final draws w/o having the atlasCallback create the // atlas #if 0 +#include "SkImageEncoder.h" #include "SkGrPriv.h" +#include "sk_tool_utils.h" + +static void save_bm(const SkBitmap& bm, const char name[]) { + bool result = sk_tool_utils::EncodeImageToFile(name, bm, SkEncodedImageFormat::kPNG, 100); + SkASSERT(result); +} sk_sp<GrTextureProxy> pre_create_atlas(GrContext* context) { SkBitmap bm; @@ -601,11 +575,6 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(OnFlushCallbackTest, reporter, ctxInfo) { object.markAsDone(); -#if 0 - save_bm(readBack, "atlas-final-image.png"); - data.saveAtlasToDisk(); -#endif - int x = kDrawnTileSize/2; test_color(reporter, readBack, x, SK_ColorRED); x += kDrawnTileSize; |