Skip to content

Commit

Permalink
onGetInfo is deprecated, just pass info to constructor
Browse files Browse the repository at this point in the history
no functionality change, just refactoring.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#328272}
  • Loading branch information
reed authored and Commit bot committed May 5, 2015
1 parent 861e7ec commit 4b06412
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
14 changes: 5 additions & 9 deletions media/blink/skcanvas_video_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,18 @@ class SyncPointClientImpl : public VideoFrame::SyncPointClient {
// Generates an RGB image from a VideoFrame. Convert YUV to RGB plain on GPU.
class VideoImageGenerator : public SkImageGenerator {
public:
VideoImageGenerator(const scoped_refptr<VideoFrame>& frame) : frame_(frame) {
VideoImageGenerator(const scoped_refptr<VideoFrame>& frame)
: SkImageGenerator(
SkImageInfo::MakeN32Premul(frame->visible_rect().width(),
frame->visible_rect().height()))
, frame_(frame) {
DCHECK(frame_.get());
}
~VideoImageGenerator() override {}

void set_frame(const scoped_refptr<VideoFrame>& frame) { frame_ = frame; }

protected:
bool onGetInfo(SkImageInfo* info) override {
info->fWidth = frame_->visible_rect().width();
info->fHeight = frame_->visible_rect().height();
info->fColorType = kN32_SkColorType;
info->fAlphaType = kPremul_SkAlphaType;
return true;
}

Result onGetPixels(const SkImageInfo& info,
void* pixels,
size_t row_bytes,
Expand Down
4 changes: 0 additions & 4 deletions skia/config/SkUserConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
# define SK_IGNORE_ETC1_SUPPORT
#endif

#ifndef SK_SUPPORT_LEGACY_BOOL_ONGETINFO
# define SK_SUPPORT_LEGACY_BOOL_ONGETINFO
#endif

#ifndef SK_IGNORE_GPU_DITHER
# define SK_IGNORE_GPU_DITHER
#endif
Expand Down

0 comments on commit 4b06412

Please sign in to comment.