From e6a15ee3d0c78eb3f2551d73a7d238c3d8d2f075 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 7 Jul 2015 18:42:17 -0700 Subject: Remove all usage of fmin and fmax bug:22208220 Removes needless call, and upconversion to doubles in multiple places. Change-Id: I1b949fa5f206446ac34de800154c0147d6bd8034 --- libs/hwui/OpenGLRenderer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 87ed84f510ca..ed2a4db9ea05 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1670,10 +1670,10 @@ void OpenGLRenderer::drawBitmap(const SkBitmap* bitmap, Rect src, Rect dst, cons if (!texture) return; const AutoTexture autoCleanup(texture); - Rect uv(fmax(0.0f, src.left / texture->width), - fmax(0.0f, src.top / texture->height), - fmin(1.0f, src.right / texture->width), - fmin(1.0f, src.bottom / texture->height)); + Rect uv(std::max(0.0f, src.left / texture->width), + std::max(0.0f, src.top / texture->height), + std::min(1.0f, src.right / texture->width), + std::min(1.0f, src.bottom / texture->height)); const int textureFillFlags = (bitmap->colorType() == kAlpha_8_SkColorType) ? TextureFillFlags::IsAlphaMaskTexture : TextureFillFlags::None; @@ -2450,7 +2450,7 @@ void OpenGLRenderer::drawTextDecorations(float underlineWidth, float x, float y, if (CC_LIKELY(underlineWidth > 0.0f)) { const float textSize = paintCopy.getTextSize(); - const float strokeWidth = fmax(textSize * kStdUnderline_Thickness, 1.0f); + const float strokeWidth = std::max(textSize * kStdUnderline_Thickness, 1.0f); const float left = x; float top = 0.0f; -- cgit v1.2.3-59-g8ed1b