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

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

Issue 1513283002: Add support to send optimal format as part of ScheduleOverlayPlane (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update cmd_buffer_functions Created 5 years 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/output/overlay_candidate.h ('k') | cc/output/overlay_unittest.cc » ('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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 default: 163 default:
164 return gfx::OVERLAY_TRANSFORM_INVALID; 164 return gfx::OVERLAY_TRANSFORM_INVALID;
165 } 165 }
166 } 166 }
167 167
168 } // namespace 168 } // namespace
169 169
170 OverlayCandidate::OverlayCandidate() 170 OverlayCandidate::OverlayCandidate()
171 : transform(gfx::OVERLAY_TRANSFORM_NONE), 171 : transform(gfx::OVERLAY_TRANSFORM_NONE),
172 format(RGBA_8888), 172 format(RGBA_8888),
173 storage_format(gfx::BufferFormat::BGRX_8888),
173 uv_rect(0.f, 0.f, 1.f, 1.f), 174 uv_rect(0.f, 0.f, 1.f, 1.f),
174 is_clipped(false), 175 is_clipped(false),
175 use_output_surface_for_resource(false), 176 use_output_surface_for_resource(false),
176 resource_id(0), 177 resource_id(0),
177 plane_z_order(0), 178 plane_z_order(0),
178 is_unoccluded(false), 179 is_unoccluded(false),
180 handle_scaling(true),
179 overlay_handled(false) {} 181 overlay_handled(false) {}
180 182
181 OverlayCandidate::~OverlayCandidate() {} 183 OverlayCandidate::~OverlayCandidate() {}
182 184
183 // static 185 // static
184 bool OverlayCandidate::FromDrawQuad(ResourceProvider* resource_provider, 186 bool OverlayCandidate::FromDrawQuad(ResourceProvider* resource_provider,
185 const DrawQuad* quad, 187 const DrawQuad* quad,
186 OverlayCandidate* candidate) { 188 OverlayCandidate* candidate) {
187 if (quad->needs_blending || quad->shared_quad_state->opacity != 1.f || 189 if (quad->needs_blending || quad->shared_quad_state->opacity != 1.f ||
188 quad->shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode) 190 quad->shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode)
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE) 323 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE)
322 return false; 324 return false;
323 candidate->resource_id = quad->io_surface_resource_id(); 325 candidate->resource_id = quad->io_surface_resource_id();
324 candidate->resource_size_in_pixels = quad->io_surface_size; 326 candidate->resource_size_in_pixels = quad->io_surface_size;
325 candidate->transform = overlay_transform; 327 candidate->transform = overlay_transform;
326 candidate->uv_rect = gfx::RectF(1.f, 1.f); 328 candidate->uv_rect = gfx::RectF(1.f, 1.f);
327 return true; 329 return true;
328 } 330 }
329 331
330 } // namespace cc 332 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_candidate.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698