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

Side by Side Diff: cc/output/overlay_candidate.cc

Issue 2683763003: cc: make resource keep video buffer format for hardware overlay.
Patch Set: make Resource keep video buffer format Created 3 years, 8 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 | « cc/layers/video_layer_impl.cc ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/output/overlay_candidate.h" 5 #include "cc/output/overlay_candidate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 candidate->uv_rect = BoundingRect(quad->uv_top_left, quad->uv_bottom_right); 279 candidate->uv_rect = BoundingRect(quad->uv_top_left, quad->uv_bottom_right);
280 return true; 280 return true;
281 } 281 }
282 282
283 // static 283 // static
284 bool OverlayCandidate::FromStreamVideoQuad(ResourceProvider* resource_provider, 284 bool OverlayCandidate::FromStreamVideoQuad(ResourceProvider* resource_provider,
285 const StreamVideoDrawQuad* quad, 285 const StreamVideoDrawQuad* quad,
286 OverlayCandidate* candidate) { 286 OverlayCandidate* candidate) {
287 if (!resource_provider->IsOverlayCandidate(quad->resource_id())) 287 if (!resource_provider->IsOverlayCandidate(quad->resource_id()))
288 return false; 288 return false;
289 candidate->format = resource_provider->GetBufferFormat(quad->resource_id());
Daniele Castagna 2017/03/28 02:01:39 We're not supposed to use the StreamVideoQuad on C
dshwang 2017/03/28 16:42:25 wow, that's why cros use StreamVideoQuad recently.
290 if (std::find(std::begin(kOverlayFormats), std::end(kOverlayFormats),
291 candidate->format) == std::end(kOverlayFormats))
292 return false;
289 gfx::OverlayTransform overlay_transform = GetOverlayTransform( 293 gfx::OverlayTransform overlay_transform = GetOverlayTransform(
290 quad->shared_quad_state->quad_to_target_transform, false); 294 quad->shared_quad_state->quad_to_target_transform, false);
291 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) 295 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID)
292 return false; 296 return false;
293 if (!quad->matrix.IsScaleOrTranslation()) { 297 if (!quad->matrix.IsScaleOrTranslation()) {
294 // We cannot handle anything other than scaling & translation for texture 298 // We cannot handle anything other than scaling & translation for texture
295 // coordinates yet. 299 // coordinates yet.
296 return false; 300 return false;
297 } 301 }
298 candidate->resource_id = quad->resource_id(); 302 candidate->resource_id = quad->resource_id();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 349
346 OverlayCandidateList& OverlayCandidateList::operator=( 350 OverlayCandidateList& OverlayCandidateList::operator=(
347 OverlayCandidateList&& other) = default; 351 OverlayCandidateList&& other) = default;
348 352
349 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { 353 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) {
350 promotion_hint_info_map_[candidate.resource_id] = 354 promotion_hint_info_map_[candidate.resource_id] =
351 candidate.display_rect.origin(); 355 candidate.display_rect.origin();
352 } 356 }
353 357
354 } // namespace cc 358 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698