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

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

Issue 139173004: [#3] Pass gfx structs by const ref (gfx::SizeF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT and fixed build error for Android platform! Created 6 years, 11 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/output/render_surface_filters.h ('k') | cc/quads/yuv_video_draw_quad.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 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/output/render_surface_filters.h" 5 #include "cc/output/render_surface_filters.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/output/filter_operation.h" 10 #include "cc/output/filter_operation.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 skia::RefPtr<SkColorFilter> color_filter = 153 skia::RefPtr<SkColorFilter> color_filter =
154 skia::AdoptRef(new SkColorMatrixFilter(matrix)); 154 skia::AdoptRef(new SkColorMatrixFilter(matrix));
155 return skia::AdoptRef( 155 return skia::AdoptRef(
156 SkColorFilterImageFilter::Create(color_filter.get(), input.get())); 156 SkColorFilterImageFilter::Create(color_filter.get(), input.get()));
157 } 157 }
158 158
159 } // namespace 159 } // namespace
160 160
161 skia::RefPtr<SkImageFilter> RenderSurfaceFilters::BuildImageFilter( 161 skia::RefPtr<SkImageFilter> RenderSurfaceFilters::BuildImageFilter(
162 const FilterOperations& filters, 162 const FilterOperations& filters,
163 gfx::SizeF size) { 163 const gfx::SizeF& size) {
164 skia::RefPtr<SkImageFilter> image_filter; 164 skia::RefPtr<SkImageFilter> image_filter;
165 SkScalar matrix[20]; 165 SkScalar matrix[20];
166 for (size_t i = 0; i < filters.size(); ++i) { 166 for (size_t i = 0; i < filters.size(); ++i) {
167 const FilterOperation& op = filters.at(i); 167 const FilterOperation& op = filters.at(i);
168 switch (op.type()) { 168 switch (op.type()) {
169 case FilterOperation::GRAYSCALE: 169 case FilterOperation::GRAYSCALE:
170 GetGrayscaleMatrix(1.f - op.amount(), matrix); 170 GetGrayscaleMatrix(1.f - op.amount(), matrix);
171 image_filter = CreateMatrixImageFilter(matrix, image_filter); 171 image_filter = CreateMatrixImageFilter(matrix, image_filter);
172 break; 172 break;
173 case FilterOperation::SEPIA: 173 case FilterOperation::SEPIA:
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 image_filter = op.image_filter(); 259 image_filter = op.image_filter();
260 } 260 }
261 break; 261 break;
262 } 262 }
263 } 263 }
264 } 264 }
265 return image_filter; 265 return image_filter;
266 } 266 }
267 267
268 } // namespace cc 268 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/render_surface_filters.h ('k') | cc/quads/yuv_video_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698