Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: tests/RecordReplaceDrawTest.cpp

Issue 2091823005: Fix vulkan warning in RecordReplaceDrawTest (Closed) Base URL: https://skia.googlesource.com/skia.git@dmTests
Patch Set: nit Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RecordReplaceDrawTest.cpp
diff --git a/tests/RecordReplaceDrawTest.cpp b/tests/RecordReplaceDrawTest.cpp
index 9e1314795421c28815a82d0ea47a44b71bd7812d..0dd804ec9d024e33c8f86a6d90b22c6e25e5951b 100644
--- a/tests/RecordReplaceDrawTest.cpp
+++ b/tests/RecordReplaceDrawTest.cpp
@@ -124,8 +124,13 @@ void test_replacements(skiatest::Reporter* r, GrContext* context, bool doReplace
desc.fHeight = kHeight;
desc.fSampleCnt = 0;
+ // Giving the texture some initial data so the Gpu (specifically vulkan) does not complain
+ // when reading from an uninitialized texture.
+ SkAutoTMalloc<uint32_t> srcBuffer(kWidth*kHeight);
+ memset(srcBuffer.get(), 0, kWidth*kHeight*sizeof(uint32_t));
+
texture.reset(context->textureProvider()->createTexture(
- desc, SkBudgeted::kNo, nullptr, 0));
+ desc, SkBudgeted::kNo, srcBuffer.get(), 0));
layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight), false);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698