Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: media/renderers/skcanvas_video_renderer.h

Issue 2547683003: Reland "Fix HTML5 video blurry" (Closed)
Patch Set: rebase to ToT Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ 5 #ifndef MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_
6 #define MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ 6 #define MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 VideoRotation video_rotation, 48 VideoRotation video_rotation,
49 const Context3D& context_3d); 49 const Context3D& context_3d);
50 50
51 // Copy |video_frame| on |canvas|. 51 // Copy |video_frame| on |canvas|.
52 // If the format of |video_frame| is PIXEL_FORMAT_NATIVE_TEXTURE, |context_3d| 52 // If the format of |video_frame| is PIXEL_FORMAT_NATIVE_TEXTURE, |context_3d|
53 // must be provided. 53 // must be provided.
54 void Copy(const scoped_refptr<VideoFrame>& video_frame, 54 void Copy(const scoped_refptr<VideoFrame>& video_frame,
55 SkCanvas* canvas, 55 SkCanvas* canvas,
56 const Context3D& context_3d); 56 const Context3D& context_3d);
57 57
58 enum class ConvertingSize { VISUAL, CODED };
58 // Convert the contents of |video_frame| to raw RGB pixels. |rgb_pixels| 59 // Convert the contents of |video_frame| to raw RGB pixels. |rgb_pixels|
59 // should point into a buffer large enough to hold as many 32 bit RGBA pixels 60 // should point into a buffer large enough to hold as many 32 bit RGBA pixels
60 // as are in the visible_rect() area of the frame. 61 // as are in the visible_rect() area of the frame.
61 static void ConvertVideoFrameToRGBPixels(const media::VideoFrame* video_frame, 62 static void ConvertVideoFrameToRGBPixels(const media::VideoFrame* video_frame,
63 ConvertingSize size_type,
62 void* rgb_pixels, 64 void* rgb_pixels,
63 size_t row_bytes); 65 size_t row_bytes);
64 66
65 // Copy the contents of texture of |video_frame| to texture |texture|. 67 // Copy the contents of texture of |video_frame| to texture |texture|.
66 // |level|, |internal_format|, |type| specify target texture |texture|. 68 // |level|, |internal_format|, |type| specify target texture |texture|.
67 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE. 69 // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE.
68 static void CopyVideoFrameSingleTextureToGLTexture( 70 static void CopyVideoFrameSingleTextureToGLTexture(
69 gpu::gles2::GLES2Interface* gl, 71 gpu::gles2::GLES2Interface* gl,
70 VideoFrame* video_frame, 72 VideoFrame* video_frame,
71 unsigned int texture, 73 unsigned int texture,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 121
120 // Used for unit test. 122 // Used for unit test.
121 SkISize last_image_dimensions_for_testing_; 123 SkISize last_image_dimensions_for_testing_;
122 124
123 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); 125 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer);
124 }; 126 };
125 127
126 } // namespace media 128 } // namespace media
127 129
128 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ 130 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698