Commit 8d58e2c4 authored by scroggo's avatar scroggo Committed by Commit bot

Update VideoImageGenerator to match new API.

SkImageGenerator is in the process of adding an enum return value to
onGetPixels. For staging, it has been replaced with onGetPixelsEnum.
(See https://codereview.chromium.org/919693002/)

Implement the new API. A follow up change will rename onGetPixelsEnum
to onGetPixels.

No need to check for null pixels; onGetPixels is only called by
getPixels which has already done the check.

R=reed@google.com,fmalita@chromium.org

BUG=skia:3257

Review URL: https://codereview.chromium.org/934263002

Cr-Commit-Position: refs/heads/master@{#317038}
parent 6a4346b2
......@@ -186,19 +186,18 @@ class VideoImageGenerator : public SkImageGenerator {
return true;
}
bool onGetPixels(const SkImageInfo& info,
// TODO (scroggo): Rename to onGetPixels once Skia is updated.
Result onGetPixelsEnum(const SkImageInfo& info,
void* pixels,
size_t row_bytes,
SkPMColor ctable[],
int* ctable_count) override {
if (!frame_.get())
return false;
if (!pixels)
return false;
return kInvalidInput;
// If skia couldn't do the YUV conversion on GPU, we will on CPU.
SkCanvasVideoRenderer::ConvertVideoFrameToRGBPixels(
frame_, pixels, row_bytes);
return true;
return kSuccess;
}
bool onGetYUV8Planes(SkISize sizes[3],
......
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