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

Side by Side Diff: cc/layers/video_layer_impl.cc

Issue 1645353003: VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/layers/video_layer_impl.h" 5 #include "cc/layers/video_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 draw_properties() 179 draw_properties()
180 .occlusion_in_content_space.GetOcclusionWithGivenDrawTransform( 180 .occlusion_in_content_space.GetOcclusionWithGivenDrawTransform(
181 transform); 181 transform);
182 gfx::Rect visible_quad_rect = 182 gfx::Rect visible_quad_rect =
183 occlusion_in_video_space.GetUnoccludedContentRect(quad_rect); 183 occlusion_in_video_space.GetUnoccludedContentRect(quad_rect);
184 if (visible_quad_rect.IsEmpty()) 184 if (visible_quad_rect.IsEmpty())
185 return; 185 return;
186 186
187 // Pixels for macroblocked formats. 187 // Pixels for macroblocked formats.
188 const float tex_width_scale = 188 const float tex_width_scale =
189 static_cast<float>(visible_rect.width()) / coded_size.width(); 189 static_cast<float>(visible_rect.width() - 1) / coded_size.width();
Pawel Osciak 2016/02/01 00:40:58 I'm wondering if we should be checking for 0,0 (an
190 const float tex_height_scale = 190 const float tex_height_scale =
191 static_cast<float>(visible_rect.height()) / coded_size.height(); 191 static_cast<float>(visible_rect.height() - 1) / coded_size.height();
192 192
193 switch (frame_resource_type_) { 193 switch (frame_resource_type_) {
194 // TODO(danakj): Remove this, hide it in the hardware path. 194 // TODO(danakj): Remove this, hide it in the hardware path.
195 case VideoFrameExternalResources::SOFTWARE_RESOURCE: { 195 case VideoFrameExternalResources::SOFTWARE_RESOURCE: {
196 DCHECK_EQ(frame_resources_.size(), 0u); 196 DCHECK_EQ(frame_resources_.size(), 0u);
197 DCHECK_EQ(software_resources_.size(), 1u); 197 DCHECK_EQ(software_resources_.size(), 1u);
198 if (software_resources_.size() < 1u) 198 if (software_resources_.size() < 1u)
199 break; 199 break;
200 bool premultiplied_alpha = true; 200 bool premultiplied_alpha = true;
201 gfx::PointF uv_top_left(0.f, 0.f); 201 gfx::PointF uv_top_left(0.f, 0.f);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 void VideoLayerImpl::SetNeedsRedraw() { 399 void VideoLayerImpl::SetNeedsRedraw() {
400 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); 400 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
401 layer_tree_impl()->SetNeedsRedraw(); 401 layer_tree_impl()->SetNeedsRedraw();
402 } 402 }
403 403
404 const char* VideoLayerImpl::LayerTypeAsString() const { 404 const char* VideoLayerImpl::LayerTypeAsString() const {
405 return "cc::VideoLayerImpl"; 405 return "cc::VideoLayerImpl";
406 } 406 }
407 407
408 } // namespace cc 408 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698