Commit b3f5329a authored by Khushal Sagar's avatar Khushal Sagar Committed by Commit Bot

gpu: Yield from raster decoder after image uploads.

Have the RasterDecoder yield to allow interruption after image transfer
cache entry deserialization. Image uploads tend to be slow operations,
its good to yield after them to allow higher priority UI work to
proceed.

R=enne@chromium.org, piman@chromium.org

Bug: 970134
Change-Id: If0f488b7efc2c0eac559733333cf4de17882ab4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643087Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666162}
parent 92499bf1
......@@ -308,6 +308,10 @@ bool ServiceImageTransferCacheEntry::MakeSkImage(
}
}
// Make sure the GPU work to create the backing texture is issued.
if (image_)
image_->getBackendTexture(true /* flushPendingGrContextIO */);
return !!image_;
}
......
......@@ -2274,9 +2274,9 @@ void RasterDecoderImpl::DoEndRasterCHROMIUM() {
locked_handles_.clear();
// We just flushed a tile's worth of GPU work from the SkSurface in
// flush above. Use kDeferLaterCommands to ensure we yield to
// the Scheduler before processing more commands.
current_decoder_error_ = error::kDeferLaterCommands;
// flush above. Yield to the Scheduler to allow pre-emption before
// processing more commands.
ExitCommandProcessingEarly();
}
void RasterDecoderImpl::DoCreateTransferCacheEntryINTERNAL(
......@@ -2340,6 +2340,12 @@ void RasterDecoderImpl::DoCreateTransferCacheEntryINTERNAL(
"Failure to deserialize transfer cache entry.");
return;
}
// The only entry using the GrContext are image transfer cache entries for
// image uploads. Since this tends to a slow operation, yield to allow the
// decoder to be pre-empted.
if (context_for_entry)
ExitCommandProcessingEarly();
}
void RasterDecoderImpl::DoUnlockTransferCacheEntryINTERNAL(
......
......@@ -257,13 +257,6 @@ TEST_P(RasterDecoderManualInitTest, CopyTexSubImage2DValidateColorFormat) {
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
}
TEST_P(RasterDecoderTest, YieldAfterEndRasterCHROMIUM) {
GetDecoder()->SetUpForRasterCHROMIUMForTest();
cmds::EndRasterCHROMIUM end_raster_cmd;
end_raster_cmd.Init();
EXPECT_EQ(error::kDeferLaterCommands, ExecuteCmd(end_raster_cmd));
}
class RasterDecoderOOPTest : public testing::Test, DecoderClient {
public:
void SetUp() override {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment