aboutsummaryrefslogtreecommitdiff
path: root/bench/AndroidCodecBench.cpp
diff options
context:
space:
mode:
authorBrian Salomon <bsalomon@google.com>2019-10-02 19:11:55 -0400
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2019-10-03 01:41:35 +0000
commit6fc04f88a89ed2c9a1b4aa48bcd28602a69a457b (patch)
treea572801510942e6bb3bda105c3d1484d31efd281 /bench/AndroidCodecBench.cpp
parent768f900a88cbfc5237e8edcc16aadde32536ed3e (diff)
downloadskia-6fc04f88a89ed2c9a1b4aa48bcd28602a69a457b.tar.gz
Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This is a reland of ce240cc6fd8ec95bd051c7df2173dad2ae8f6ad6 Original change's description: > SkSurface asynchronous read APIs allow client to extend pixel lifetime > > Previously the pixel data passed to the client was only valid during > the client's callback. This meant if the client wanted to defer > processing of the data a copy was necessary. > > Now we pass an object to the callback and the pixel lifetime is tied > to the lifetime of that object. > > The object may be holding a GPU transfer buffer mapped. We don't assume > that the object will be released on the direct GrContext thread. So > when the object is destroyed it posts a message to a new type, > GrClientMappedBufferManager, hanging off the direct context. The direct > context will periodically check for messages and unmap and then unref > buffers so that they can be reused. Currently this is done in > GrContext::performDeferredCleanup() and GrDrawingManager::flush(). > > The old API is kept around for backwards compatibility but it is > reimplemented as a bridge on top of the new mechanism. > > Also a utility function to SkImageInfo is added to directly make a new > info with a specified dimensions rather than passing the width and > height separately to makeWH(). > > Bug: chromium:973403 > Bug: skia:8962 > > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> Bug: chromium:973403, skia:8962 Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'bench/AndroidCodecBench.cpp')
-rw-r--r--bench/AndroidCodecBench.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/bench/AndroidCodecBench.cpp b/bench/AndroidCodecBench.cpp
index 96f50c6581..894c21bcaa 100644
--- a/bench/AndroidCodecBench.cpp
+++ b/bench/AndroidCodecBench.cpp
@@ -32,8 +32,7 @@ void AndroidCodecBench::onDelayedSetup() {
std::unique_ptr<SkAndroidCodec> codec(SkAndroidCodec::MakeFromData(fData));
SkISize scaledSize = codec->getSampledDimensions(fSampleSize);
- fInfo = codec->getInfo().makeWH(scaledSize.width(), scaledSize.height())
- .makeColorType(kN32_SkColorType);
+ fInfo = codec->getInfo().makeDimensions(scaledSize).makeColorType(kN32_SkColorType);
if (kUnpremul_SkAlphaType == fInfo.alphaType()) {
fInfo = fInfo.makeAlphaType(kPremul_SkAlphaType);
}