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

Unified Diff: media/tools/shader_bench/cpu_color_painter.cc

Issue 11269017: Plumb through cropped output size for VideoFrame (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Found the windows failure, and fixed it. Thanks akalin@ Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/tools/scaler_bench/scaler_bench.cc ('k') | media/tools/shader_bench/gpu_color_painter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/shader_bench/cpu_color_painter.cc
diff --git a/media/tools/shader_bench/cpu_color_painter.cc b/media/tools/shader_bench/cpu_color_painter.cc
index b99b803a284717b517a1cefb3c251f9cbeeaf438..a7cb570cdf906e5d8558097595b64ae635737b97 100644
--- a/media/tools/shader_bench/cpu_color_painter.cc
+++ b/media/tools/shader_bench/cpu_color_painter.cc
@@ -67,7 +67,8 @@ void CPUColorPainter::Paint(scoped_refptr<media::VideoFrame> video_frame) {
// Convert to RGB32 frame.
scoped_refptr<media::VideoFrame> rgba_frame =
media::VideoFrame::CreateFrame(media::VideoFrame::RGB32,
- video_frame->data_size(),
+ video_frame->coded_size(),
+ video_frame->visible_rect(),
video_frame->natural_size(),
base::TimeDelta());
@@ -75,16 +76,19 @@ void CPUColorPainter::Paint(scoped_refptr<media::VideoFrame> video_frame) {
video_frame->data(media::VideoFrame::kUPlane),
video_frame->data(media::VideoFrame::kVPlane),
rgba_frame->data(0),
- video_frame->data_size().width(),
- video_frame->data_size().height(),
+ video_frame->coded_size().width(),
+ video_frame->coded_size().height(),
video_frame->stride(media::VideoFrame::kYPlane),
video_frame->stride(media::VideoFrame::kUPlane),
rgba_frame->stride(0),
media::YV12);
glBindTexture(GL_TEXTURE_2D, textures_[0]);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, rgba_frame->data_size().width(),
- rgba_frame->data_size().height(), GL_RGBA, GL_UNSIGNED_BYTE,
+ // Not accounting for x/y offset presently.
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
+ rgba_frame->visible_rect().width(),
+ rgba_frame->visible_rect().height(),
+ GL_RGBA, GL_UNSIGNED_BYTE,
rgba_frame->data(0));
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
« no previous file with comments | « media/tools/scaler_bench/scaler_bench.cc ('k') | media/tools/shader_bench/gpu_color_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698