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

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

Issue 10824141: Remove VideoDecoder::natural_size() & added VideoFrame::natural_size(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright year. Created 8 years, 5 months 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/shader_bench/cpu_color_painter.cc ('k') | media/tools/shader_bench/shader_bench.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/shader_bench/gpu_color_painter.cc
diff --git a/media/tools/shader_bench/gpu_color_painter.cc b/media/tools/shader_bench/gpu_color_painter.cc
index 2c81d2b80f1f183e5fbf7ac296c13f565f300949..a408de2013ddb92afdcfa28d16f923dccd3dce7d 100644
--- a/media/tools/shader_bench/gpu_color_painter.cc
+++ b/media/tools/shader_bench/gpu_color_painter.cc
@@ -104,13 +104,15 @@ void GPUColorWithLuminancePainter::Initialize(int width, int height) {
void GPUColorWithLuminancePainter::Paint(
scoped_refptr<media::VideoFrame> video_frame) {
+ int width = video_frame->data_size().width();
+ int height = video_frame->data_size().height();
for (unsigned int i = 0; i < kNumYUVPlanes; ++i) {
- unsigned int width = (i == media::VideoFrame::kYPlane) ?
- video_frame->width() : video_frame->width() / 2;
- unsigned int height = (i == media::VideoFrame::kYPlane) ?
- video_frame->height() : video_frame->height() / 2;
+ unsigned int plane_width =
+ (i == media::VideoFrame::kYPlane) ? width : width / 2;
+ unsigned int plane_height =
+ (i == media::VideoFrame::kYPlane) ? height : height / 2;
glBindTexture(GL_TEXTURE_2D, textures_[i]);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, plane_width, plane_height,
GL_LUMINANCE, GL_UNSIGNED_BYTE, video_frame->data(i));
}
« no previous file with comments | « media/tools/shader_bench/cpu_color_painter.cc ('k') | media/tools/shader_bench/shader_bench.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698