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

Side by Side Diff: cc/base/math_util.cc

Issue 2179003003: cc: disable denorm handling before calling into Skia's filter code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Protect orig_state_ member var with #ifdef __SSE__. Created 4 years, 4 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 | « cc/base/math_util.h ('k') | cc/output/software_renderer.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/base/math_util.h" 5 #include "cc/base/math_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #ifdef __SSE__
11 #include <xmmintrin.h>
12 #endif
10 13
11 #include "base/trace_event/trace_event_argument.h" 14 #include "base/trace_event/trace_event_argument.h"
12 #include "base/values.h" 15 #include "base/values.h"
13 #include "ui/gfx/geometry/quad_f.h" 16 #include "ui/gfx/geometry/quad_f.h"
14 #include "ui/gfx/geometry/rect.h" 17 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/rect_conversions.h" 18 #include "ui/gfx/geometry/rect_conversions.h"
16 #include "ui/gfx/geometry/rect_f.h" 19 #include "ui/gfx/geometry/rect_f.h"
17 #include "ui/gfx/geometry/vector2d_f.h" 20 #include "ui/gfx/geometry/vector2d_f.h"
18 #include "ui/gfx/geometry/vector3d_f.h" 21 #include "ui/gfx/geometry/vector3d_f.h"
19 #include "ui/gfx/transform.h" 22 #include "ui/gfx/transform.h"
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 transform.matrix().getFloat(1, 0), 914 transform.matrix().getFloat(1, 0),
912 transform.matrix().getFloat(2, 0)); 915 transform.matrix().getFloat(2, 0));
913 } 916 }
914 917
915 gfx::Vector3dF MathUtil::GetYAxis(const gfx::Transform& transform) { 918 gfx::Vector3dF MathUtil::GetYAxis(const gfx::Transform& transform) {
916 return gfx::Vector3dF(transform.matrix().getFloat(0, 1), 919 return gfx::Vector3dF(transform.matrix().getFloat(0, 1),
917 transform.matrix().getFloat(1, 1), 920 transform.matrix().getFloat(1, 1),
918 transform.matrix().getFloat(2, 1)); 921 transform.matrix().getFloat(2, 1));
919 } 922 }
920 923
924 ScopedSubnormalFloatDisabler::ScopedSubnormalFloatDisabler() {
925 #ifdef __SSE__
926 // Turn on "subnormals are zero" and "flush to zero" CSR flags.
927 orig_state_ = _mm_getcsr();
928 _mm_setcsr(orig_state_ | 0x8040);
929 #endif
930 }
931
932 ScopedSubnormalFloatDisabler::~ScopedSubnormalFloatDisabler() {
933 #ifdef __SSE__
934 _mm_setcsr(orig_state_);
935 #endif
936 }
937
921 } // namespace cc 938 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/math_util.h ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698