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

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

Issue 576173003: cc: Move UnoccludedContentRect to Occlusion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/layers/video_frame_provider_client_impl.h" 9 #include "cc/layers/video_frame_provider_client_impl.h"
10 #include "cc/quads/io_surface_draw_quad.h" 10 #include "cc/quads/io_surface_draw_quad.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 AppendDebugBorderQuad( 171 AppendDebugBorderQuad(
172 render_pass, rotated_size, shared_quad_state, append_quads_data); 172 render_pass, rotated_size, shared_quad_state, append_quads_data);
173 173
174 gfx::Rect quad_rect(rotated_size); 174 gfx::Rect quad_rect(rotated_size);
175 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); 175 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect());
176 gfx::Rect visible_rect = frame_->visible_rect(); 176 gfx::Rect visible_rect = frame_->visible_rect();
177 gfx::Size coded_size = frame_->coded_size(); 177 gfx::Size coded_size = frame_->coded_size();
178 178
179 gfx::Rect visible_quad_rect = 179 gfx::Rect visible_quad_rect =
180 occlusion_tracker.UnoccludedContentRect(quad_rect, transform); 180 occlusion_tracker.GetCurrentOcclusionForLayer(transform)
181 .GetUnoccludedContentRect(quad_rect);
181 if (visible_quad_rect.IsEmpty()) 182 if (visible_quad_rect.IsEmpty())
182 return; 183 return;
183 184
184 // Pixels for macroblocked formats. 185 // Pixels for macroblocked formats.
185 const float tex_width_scale = 186 const float tex_width_scale =
186 static_cast<float>(visible_rect.width()) / coded_size.width(); 187 static_cast<float>(visible_rect.width()) / coded_size.width();
187 const float tex_height_scale = 188 const float tex_height_scale =
188 static_cast<float>(visible_rect.height()) / coded_size.height(); 189 static_cast<float>(visible_rect.height()) / coded_size.height();
189 const float tex_x_offset = 190 const float tex_x_offset =
190 static_cast<float>(visible_rect.x()) / coded_size.width(); 191 static_cast<float>(visible_rect.x()) / coded_size.width();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 void VideoLayerImpl::SetProviderClientImpl( 369 void VideoLayerImpl::SetProviderClientImpl(
369 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { 370 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) {
370 provider_client_impl_ = provider_client_impl; 371 provider_client_impl_ = provider_client_impl;
371 } 372 }
372 373
373 const char* VideoLayerImpl::LayerTypeAsString() const { 374 const char* VideoLayerImpl::LayerTypeAsString() const {
374 return "cc::VideoLayerImpl"; 375 return "cc::VideoLayerImpl";
375 } 376 }
376 377
377 } // namespace cc 378 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698