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

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

Issue 122443005: replace deprecated SkScalarRound/Floor/Ceil calls with more explicit variants (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/badge_util.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/output/software_renderer.h" 5 #include "cc/output/software_renderer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 18 matching lines...) Expand all
29 #include "third_party/skia/include/effects/SkLayerRasterizer.h" 29 #include "third_party/skia/include/effects/SkLayerRasterizer.h"
30 #include "ui/gfx/rect_conversions.h" 30 #include "ui/gfx/rect_conversions.h"
31 #include "ui/gfx/skia_util.h" 31 #include "ui/gfx/skia_util.h"
32 #include "ui/gfx/transform.h" 32 #include "ui/gfx/transform.h"
33 33
34 namespace cc { 34 namespace cc {
35 35
36 namespace { 36 namespace {
37 37
38 static inline bool IsScalarNearlyInteger(SkScalar scalar) { 38 static inline bool IsScalarNearlyInteger(SkScalar scalar) {
39 return SkScalarNearlyZero(scalar - SkScalarRound(scalar)); 39 return SkScalarNearlyZero(scalar - SkScalarRoundToScalar(scalar));
40 } 40 }
41 41
42 bool IsScaleAndIntegerTranslate(const SkMatrix& matrix) { 42 bool IsScaleAndIntegerTranslate(const SkMatrix& matrix) {
43 return IsScalarNearlyInteger(matrix[SkMatrix::kMTransX]) && 43 return IsScalarNearlyInteger(matrix[SkMatrix::kMTransX]) &&
44 IsScalarNearlyInteger(matrix[SkMatrix::kMTransY]) && 44 IsScalarNearlyInteger(matrix[SkMatrix::kMTransY]) &&
45 SkScalarNearlyZero(matrix[SkMatrix::kMSkewX]) && 45 SkScalarNearlyZero(matrix[SkMatrix::kMSkewX]) &&
46 SkScalarNearlyZero(matrix[SkMatrix::kMSkewY]) && 46 SkScalarNearlyZero(matrix[SkMatrix::kMSkewY]) &&
47 SkScalarNearlyZero(matrix[SkMatrix::kMPersp0]) && 47 SkScalarNearlyZero(matrix[SkMatrix::kMPersp0]) &&
48 SkScalarNearlyZero(matrix[SkMatrix::kMPersp1]) && 48 SkScalarNearlyZero(matrix[SkMatrix::kMPersp1]) &&
49 SkScalarNearlyZero(matrix[SkMatrix::kMPersp2] - 1.0f); 49 SkScalarNearlyZero(matrix[SkMatrix::kMPersp2] - 1.0f);
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 return; 602 return;
603 visible_ = visible; 603 visible_ = visible;
604 604
605 if (visible_) 605 if (visible_)
606 EnsureBackbuffer(); 606 EnsureBackbuffer();
607 else 607 else
608 DiscardBackbuffer(); 608 DiscardBackbuffer();
609 } 609 }
610 610
611 } // namespace cc 611 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | chrome/common/badge_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698