Commit 3cbdc04d authored by Mostyn Bramley-Moore's avatar Mostyn Bramley-Moore Committed by Commit Bot

use cmath functions instead of math.h for consistency

std::isnan seems to be used a lot more in the tree and other cmath
functions are used in base_rendering_context_2d.cc, so let's use
std::isnan here too.  This has a side benefit of working on some
older toolchains that don't like to mix math.h and cmath.

While we're at it, include the required header files for other
standard library types.

Change-Id: I61c9333c984dd1332f1f18ce21550474a193275c
Reviewed-on: https://chromium-review.googlesource.com/c/1301440Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com>
Cr-Commit-Position: refs/heads/master@{#603093}
parent aa60c219
......@@ -4,6 +4,10 @@
#include "third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.h"
#include <algorithm>
#include <cmath>
#include <memory>
#include "base/numerics/checked_math.h"
#include "third_party/blink/renderer/core/css/cssom/css_url_image_value.h"
#include "third_party/blink/renderer/core/css/parser/css_parser.h"
......@@ -650,8 +654,8 @@ void BaseRenderingContext2D::DrawPathInternal(
SkPath sk_path = path.GetSkPath();
FloatRect bounds = path.BoundingRect();
if (isnan(bounds.X()) || isnan(bounds.Y()) || isnan(bounds.Width()) ||
isnan(bounds.Height()))
if (std::isnan(bounds.X()) || std::isnan(bounds.Y()) ||
std::isnan(bounds.Width()) || std::isnan(bounds.Height()))
return;
sk_path.setFillType(fill_type);
......
......@@ -5,6 +5,8 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_CANVAS_CANVAS2D_BASE_RENDERING_CONTEXT_2D_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_CANVAS_CANVAS2D_BASE_RENDERING_CONTEXT_2D_H_
#include <utility>
#include "third_party/blink/renderer/bindings/modules/v8/canvas_image_source.h"
#include "third_party/blink/renderer/bindings/modules/v8/string_or_canvas_gradient_or_canvas_pattern.h"
#include "third_party/blink/renderer/core/geometry/dom_matrix.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment