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

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

Issue 2004443002: cc: Update SpreadForStdDeviation to 3*sigma, and update tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | cc/output/filter_operations.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 value->AppendInteger(it.rect().width()); 309 value->AppendInteger(it.rect().width());
310 value->AppendInteger(it.rect().height()); 310 value->AppendInteger(it.rect().height());
311 } 311 }
312 value->EndArray(); 312 value->EndArray();
313 } 313 }
314 break; 314 break;
315 } 315 }
316 } 316 }
317 317
318 static SkVector MapStdDeviation(float std_deviation, const SkMatrix& matrix) { 318 static SkVector MapStdDeviation(float std_deviation, const SkMatrix& matrix) {
319 // Corresponds to SpreadForStdDeviation in filter_operations.cc.
319 SkVector sigma = SkVector::Make(std_deviation, std_deviation); 320 SkVector sigma = SkVector::Make(std_deviation, std_deviation);
320 matrix.mapVectors(&sigma, 1); 321 matrix.mapVectors(&sigma, 1);
321 return sigma * SkIntToScalar(3); 322 return sigma * SkIntToScalar(3);
322 } 323 }
323 324
324 gfx::Rect FilterOperation::MapRect(const gfx::Rect& rect, 325 gfx::Rect FilterOperation::MapRect(const gfx::Rect& rect,
325 const SkMatrix& matrix) const { 326 const SkMatrix& matrix) const {
326 switch (type_) { 327 switch (type_) {
327 case FilterOperation::BLUR: { 328 case FilterOperation::BLUR: {
328 SkVector spread = MapStdDeviation(amount(), matrix); 329 SkVector spread = MapStdDeviation(amount(), matrix);
(...skipping 16 matching lines...) Expand all
345 SkIRect out_rect = image_filter()->filterBounds( 346 SkIRect out_rect = image_filter()->filterBounds(
346 in_rect, matrix, SkImageFilter::kForward_MapDirection); 347 in_rect, matrix, SkImageFilter::kForward_MapDirection);
347 return gfx::SkIRectToRect(out_rect); 348 return gfx::SkIRectToRect(out_rect);
348 } 349 }
349 default: 350 default:
350 return rect; 351 return rect;
351 } 352 }
352 } 353 }
353 354
354 } // namespace cc 355 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/filter_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698