summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 01:51:39 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-05 01:51:39 +0000
commitde6b07ebe55062c249328533e610a8620691d4fc (patch)
tree87d85ea0b8287ec72d07362f67411ce6d87a5c9d /cc
parenta2cdfe8a194500e76171a0ef2e8ab6257dccfb51 (diff)
downloadchromium_src-de6b07ebe55062c249328533e610a8620691d4fc.zip
chromium_src-de6b07ebe55062c249328533e610a8620691d4fc.tar.gz
chromium_src-de6b07ebe55062c249328533e610a8620691d4fc.tar.bz2
cc: Get rid of FloatToSkScalar() function.
Accordding to Dana: "We can probably just call SkFloatToScalar directly in those sites. Those values should never be NaN or infinity." BUG=147395 TEST=cc_unittests R=enne@chromium.org,danakj@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11293084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/cc.gyp2
-rw-r--r--cc/content_layer_updater.cc6
-rw-r--r--cc/stubs/SkiaUtils.h6
-rw-r--r--cc/stubs/skia_utils.h29
4 files changed, 3 insertions, 40 deletions
diff --git a/cc/cc.gyp b/cc/cc.gyp
index 942e870..5944570 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -262,7 +262,6 @@
'stubs/IntPoint.h',
'stubs/IntSize.h',
'stubs/Region.h',
- 'stubs/SkiaUtils.h',
'stubs/UnitBezier.h',
'stubs/config.h',
@@ -270,7 +269,6 @@
'stubs/float_size.h',
'stubs/int_point.h',
'stubs/int_size.h',
- 'stubs/skia_utils.h',
'stubs/unit_bezier.h',
],
},
diff --git a/cc/content_layer_updater.cc b/cc/content_layer_updater.cc
index 8888e0d..5ad5f85 100644
--- a/cc/content_layer_updater.cc
+++ b/cc/content_layer_updater.cc
@@ -6,7 +6,6 @@
#include "cc/content_layer_updater.h"
-#include "SkiaUtils.h"
#include "base/debug/trace_event.h"
#include "base/time.h"
#include "cc/layer_painter.h"
@@ -14,6 +13,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkRect.h"
+#include "third_party/skia/include/core/SkScalar.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/rect_f.h"
@@ -32,12 +32,12 @@ void ContentLayerUpdater::paintContents(SkCanvas* canvas, const gfx::Rect& conte
{
TRACE_EVENT0("cc", "ContentLayerUpdater::paintContents");
canvas->save();
- canvas->translate(FloatToSkScalar(-contentRect.x()), FloatToSkScalar(-contentRect.y()));
+ canvas->translate(SkFloatToScalar(-contentRect.x()), SkFloatToScalar(-contentRect.y()));
gfx::Rect layerRect = contentRect;
if (contentsWidthScale != 1 || contentsHeightScale != 1) {
- canvas->scale(FloatToSkScalar(contentsWidthScale), FloatToSkScalar(contentsHeightScale));
+ canvas->scale(SkFloatToScalar(contentsWidthScale), SkFloatToScalar(contentsHeightScale));
gfx::RectF rect = gfx::ScaleRect(contentRect, 1 / contentsWidthScale, 1 / contentsHeightScale);
layerRect = gfx::ToEnclosingRect(rect);
diff --git a/cc/stubs/SkiaUtils.h b/cc/stubs/SkiaUtils.h
deleted file mode 100644
index c3bbf89..0000000
--- a/cc/stubs/SkiaUtils.h
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Temporary forwarding header
-#include "cc/stubs/skia_utils.h"
diff --git a/cc/stubs/skia_utils.h b/cc/stubs/skia_utils.h
deleted file mode 100644
index 8404fa3..0000000
--- a/cc/stubs/skia_utils.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_STUBS_SKIAUTILS_H_
-#define CC_STUBS_SKIAUTILS_H_
-
-#include <limits>
-
-#include "third_party/skia/include/core/SkScalar.h"
-
-namespace cc {
-
-// Skia has problems when passed infinite, etc floats, filter them to 0.
-inline SkScalar FloatToSkScalar(float f)
-{
- // This checks if |f| is NaN.
- if (f != f)
- return 0;
- if (f == std::numeric_limits<double>::infinity())
- return 0;
- if (f == -std::numeric_limits<double>::infinity())
- return 0;
- return SkFloatToScalar(f);
-}
-
-}
-
-#endif // CC_STUBS_SKIAUTILS_H_