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

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

Issue 2683763003: cc: make resource keep video buffer format for hardware overlay.
Patch Set: Created 3 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
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 break; 161 break;
162 default: 162 default:
163 return gfx::OVERLAY_TRANSFORM_INVALID; 163 return gfx::OVERLAY_TRANSFORM_INVALID;
164 } 164 }
165 } 165 }
166 166
167 } // namespace 167 } // namespace
168 168
169 OverlayCandidate::OverlayCandidate() 169 OverlayCandidate::OverlayCandidate()
170 : transform(gfx::OVERLAY_TRANSFORM_NONE), 170 : transform(gfx::OVERLAY_TRANSFORM_NONE),
171 format(RGBA_8888), 171 format(gfx::BufferFormat::RGBA_8888),
172 uv_rect(0.f, 0.f, 1.f, 1.f), 172 uv_rect(0.f, 0.f, 1.f, 1.f),
173 is_clipped(false), 173 is_clipped(false),
174 use_output_surface_for_resource(false), 174 use_output_surface_for_resource(false),
175 resource_id(0), 175 resource_id(0),
176 #if defined(OS_ANDROID) 176 #if defined(OS_ANDROID)
177 is_backed_by_surface_texture(false), 177 is_backed_by_surface_texture(false),
178 is_promotable_hint(false), 178 is_promotable_hint(false),
179 #endif 179 #endif
180 plane_z_order(0), 180 plane_z_order(0),
181 is_unoccluded(false), 181 is_unoccluded(false),
(...skipping 12 matching lines...) Expand all
194 quad->shared_quad_state->opacity != 1.f || 194 quad->shared_quad_state->opacity != 1.f ||
195 quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver) 195 quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver)
196 return false; 196 return false;
197 197
198 auto& transform = quad->shared_quad_state->quad_to_target_transform; 198 auto& transform = quad->shared_quad_state->quad_to_target_transform;
199 candidate->display_rect = gfx::RectF(quad->rect); 199 candidate->display_rect = gfx::RectF(quad->rect);
200 transform.TransformRect(&candidate->display_rect); 200 transform.TransformRect(&candidate->display_rect);
201 candidate->quad_rect_in_target_space = 201 candidate->quad_rect_in_target_space =
202 MathUtil::MapEnclosingClippedRect(transform, quad->rect); 202 MathUtil::MapEnclosingClippedRect(transform, quad->rect);
203 203
204 candidate->format = RGBA_8888; 204 candidate->format = gfx::BufferFormat::RGBA_8888;
205 candidate->clip_rect = quad->shared_quad_state->clip_rect; 205 candidate->clip_rect = quad->shared_quad_state->clip_rect;
206 candidate->is_clipped = quad->shared_quad_state->is_clipped; 206 candidate->is_clipped = quad->shared_quad_state->is_clipped;
207 207
208 switch (quad->material) { 208 switch (quad->material) {
209 case DrawQuad::TEXTURE_CONTENT: 209 case DrawQuad::TEXTURE_CONTENT:
210 return FromTextureQuad(resource_provider, 210 return FromTextureQuad(resource_provider,
211 TextureDrawQuad::MaterialCast(quad), candidate); 211 TextureDrawQuad::MaterialCast(quad), candidate);
212 case DrawQuad::STREAM_VIDEO_CONTENT: 212 case DrawQuad::STREAM_VIDEO_CONTENT:
213 return FromStreamVideoQuad(resource_provider, 213 return FromStreamVideoQuad(resource_provider,
214 StreamVideoDrawQuad::MaterialCast(quad), 214 StreamVideoDrawQuad::MaterialCast(quad),
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 OverlayCandidateList& OverlayCandidateList::operator=( 335 OverlayCandidateList& OverlayCandidateList::operator=(
336 OverlayCandidateList&& other) = default; 336 OverlayCandidateList&& other) = default;
337 337
338 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) { 338 void OverlayCandidateList::AddPromotionHint(const OverlayCandidate& candidate) {
339 promotion_hint_info_map_[candidate.resource_id] = 339 promotion_hint_info_map_[candidate.resource_id] =
340 candidate.display_rect.origin(); 340 candidate.display_rect.origin();
341 } 341 }
342 342
343 } // namespace cc 343 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698