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

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

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 6 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/layers/delegated_frame_provider_unittest.cc ('k') | cc/layers/nine_patch_layer_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/heads_up_display_layer_impl.h" 5 #include "cc/layers/heads_up_display_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 PopulateSharedQuadState(shared_quad_state); 141 PopulateSharedQuadState(shared_quad_state);
142 142
143 gfx::Rect quad_rect(content_bounds()); 143 gfx::Rect quad_rect(content_bounds());
144 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); 144 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect());
145 gfx::Rect visible_quad_rect(quad_rect); 145 gfx::Rect visible_quad_rect(quad_rect);
146 bool premultiplied_alpha = true; 146 bool premultiplied_alpha = true;
147 gfx::PointF uv_top_left(0.f, 0.f); 147 gfx::PointF uv_top_left(0.f, 0.f);
148 gfx::PointF uv_bottom_right(1.f, 1.f); 148 gfx::PointF uv_bottom_right(1.f, 1.f);
149 const float vertex_opacity[] = { 1.f, 1.f, 1.f, 1.f }; 149 const float vertex_opacity[] = { 1.f, 1.f, 1.f, 1.f };
150 bool flipped = false; 150 bool flipped = false;
151 bool nearest_neighbor = false;
151 TextureDrawQuad* quad = 152 TextureDrawQuad* quad =
152 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); 153 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
153 quad->SetNew(shared_quad_state, 154 quad->SetNew(shared_quad_state,
154 quad_rect, 155 quad_rect,
155 opaque_rect, 156 opaque_rect,
156 visible_quad_rect, 157 visible_quad_rect,
157 resources_.back()->id(), 158 resources_.back()->id(),
158 premultiplied_alpha, 159 premultiplied_alpha,
159 uv_top_left, 160 uv_top_left,
160 uv_bottom_right, 161 uv_bottom_right,
161 SK_ColorTRANSPARENT, 162 SK_ColorTRANSPARENT,
162 vertex_opacity, 163 vertex_opacity,
163 flipped); 164 flipped,
165 nearest_neighbor);
164 } 166 }
165 167
166 void HeadsUpDisplayLayerImpl::UpdateHudTexture( 168 void HeadsUpDisplayLayerImpl::UpdateHudTexture(
167 DrawMode draw_mode, 169 DrawMode draw_mode,
168 ResourceProvider* resource_provider) { 170 ResourceProvider* resource_provider) {
169 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id()) 171 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id())
170 return; 172 return;
171 173
172 SkISize canvas_size; 174 SkISize canvas_size;
173 if (hud_canvas_) 175 if (hud_canvas_)
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 return "cc::HeadsUpDisplayLayerImpl"; 781 return "cc::HeadsUpDisplayLayerImpl";
780 } 782 }
781 783
782 void HeadsUpDisplayLayerImpl::AsValueInto( 784 void HeadsUpDisplayLayerImpl::AsValueInto(
783 base::debug::TracedValue* dict) const { 785 base::debug::TracedValue* dict) const {
784 LayerImpl::AsValueInto(dict); 786 LayerImpl::AsValueInto(dict);
785 dict->SetString("layer_name", "Heads Up Display Layer"); 787 dict->SetString("layer_name", "Heads Up Display Layer");
786 } 788 }
787 789
788 } // namespace cc 790 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/delegated_frame_provider_unittest.cc ('k') | cc/layers/nine_patch_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698