| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/renderers/skcanvas_video_renderer.h" | 5 #include "media/renderers/skcanvas_video_renderer.h" |
| 6 | 6 |
| 7 #include <GLES3/gl3.h> | 7 #include <GLES3/gl3.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 frame->visible_rect().height())), | 237 frame->visible_rect().height())), |
| 238 frame_(frame) { | 238 frame_(frame) { |
| 239 DCHECK(!frame_->HasTextures()); | 239 DCHECK(!frame_->HasTextures()); |
| 240 } | 240 } |
| 241 ~VideoImageGenerator() override {} | 241 ~VideoImageGenerator() override {} |
| 242 | 242 |
| 243 protected: | 243 protected: |
| 244 bool onGetPixels(const SkImageInfo& info, | 244 bool onGetPixels(const SkImageInfo& info, |
| 245 void* pixels, | 245 void* pixels, |
| 246 size_t row_bytes, | 246 size_t row_bytes, |
| 247 SkPMColor ctable[], | 247 const Options&) override { |
| 248 int* ctable_count) override { | |
| 249 // If skia couldn't do the YUV conversion on GPU, we will on CPU. | 248 // If skia couldn't do the YUV conversion on GPU, we will on CPU. |
| 250 SkCanvasVideoRenderer::ConvertVideoFrameToRGBPixels(frame_.get(), pixels, | 249 SkCanvasVideoRenderer::ConvertVideoFrameToRGBPixels(frame_.get(), pixels, |
| 251 row_bytes); | 250 row_bytes); |
| 252 return true; | 251 return true; |
| 253 } | 252 } |
| 254 | 253 |
| 255 bool onQueryYUV8(SkYUVSizeInfo* sizeInfo, | 254 bool onQueryYUV8(SkYUVSizeInfo* sizeInfo, |
| 256 SkYUVColorSpace* color_space) const override { | 255 SkYUVColorSpace* color_space) const override { |
| 257 if (!media::IsYuvPlanar(frame_->format()) || | 256 if (!media::IsYuvPlanar(frame_->format()) || |
| 258 // TODO(rileya): Skia currently doesn't support YUVA conversion. Remove | 257 // TODO(rileya): Skia currently doesn't support YUVA conversion. Remove |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 last_image_->bounds().contains(visible_rect)) { | 1088 last_image_->bounds().contains(visible_rect)) { |
| 1090 last_image_ = last_image_->makeSubset(visible_rect); | 1089 last_image_ = last_image_->makeSubset(visible_rect); |
| 1091 } | 1090 } |
| 1092 } | 1091 } |
| 1093 | 1092 |
| 1094 SkISize SkCanvasVideoRenderer::LastImageDimensionsForTesting() { | 1093 SkISize SkCanvasVideoRenderer::LastImageDimensionsForTesting() { |
| 1095 return last_image_dimensions_for_testing_; | 1094 return last_image_dimensions_for_testing_; |
| 1096 } | 1095 } |
| 1097 | 1096 |
| 1098 } // namespace media | 1097 } // namespace media |
| OLD | NEW |