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

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

Issue 2913083002: cc: Fix CALayer filtering for TileDrawQuad (Closed)
Patch Set: Created 3 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ca_layer_overlay.h" 5 #include "cc/output/ca_layer_overlay.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "cc/quads/render_pass_draw_quad.h" 10 #include "cc/quads/render_pass_draw_quad.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 CALayerResult FromTileQuad(ResourceProvider* resource_provider, 161 CALayerResult FromTileQuad(ResourceProvider* resource_provider,
162 const TileDrawQuad* quad, 162 const TileDrawQuad* quad,
163 CALayerOverlay* ca_layer_overlay) { 163 CALayerOverlay* ca_layer_overlay) {
164 unsigned resource_id = quad->resource_id(); 164 unsigned resource_id = quad->resource_id();
165 if (!resource_provider->IsOverlayCandidate(resource_id)) 165 if (!resource_provider->IsOverlayCandidate(resource_id))
166 return CA_LAYER_FAILED_TILE_NOT_CANDIDATE; 166 return CA_LAYER_FAILED_TILE_NOT_CANDIDATE;
167 ca_layer_overlay->contents_resource_id = resource_id; 167 ca_layer_overlay->contents_resource_id = resource_id;
168 ca_layer_overlay->contents_rect = quad->tex_coord_rect; 168 ca_layer_overlay->contents_rect = quad->tex_coord_rect;
169 ca_layer_overlay->contents_rect.Scale(1.f / quad->texture_size.width(), 169 ca_layer_overlay->contents_rect.Scale(1.f / quad->texture_size.width(),
170 1.f / quad->texture_size.height()); 170 1.f / quad->texture_size.height());
171 ca_layer_overlay->filter = quad->nearest_neighbor ? GL_NEAREST : GL_LINEAR;
171 return CA_LAYER_SUCCESS; 172 return CA_LAYER_SUCCESS;
172 } 173 }
173 174
174 class CALayerOverlayProcessor { 175 class CALayerOverlayProcessor {
175 public: 176 public:
176 CALayerResult FromDrawQuad( 177 CALayerResult FromDrawQuad(
177 ResourceProvider* resource_provider, 178 ResourceProvider* resource_provider,
178 const gfx::RectF& display_rect, 179 const gfx::RectF& display_rect,
179 const DrawQuad* quad, 180 const DrawQuad* quad,
180 const base::flat_map<int, FilterOperations*>& render_pass_filters, 181 const base::flat_map<int, FilterOperations*>& render_pass_filters,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 CA_LAYER_FAILED_COUNT); 334 CA_LAYER_FAILED_COUNT);
334 335
335 if (result != CA_LAYER_SUCCESS) { 336 if (result != CA_LAYER_SUCCESS) {
336 ca_layer_overlays->clear(); 337 ca_layer_overlays->clear();
337 return false; 338 return false;
338 } 339 }
339 return true; 340 return true;
340 } 341 }
341 342
342 } // namespace cc 343 } // 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