| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayer.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayer.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayer.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayer.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.
h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.
h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
| 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
| 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebSolidColorLayer.
h" | 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebSolidColorLayer.
h" |
| 21 #include "ui/base/animation/animation.h" | 21 #include "ui/base/animation/animation.h" |
| 22 #include "ui/compositor/compositor_switches.h" | 22 #include "ui/compositor/compositor_switches.h" |
| 23 #include "ui/compositor/dip_util.h" | 23 #include "ui/compositor/dip_util.h" |
| 24 #include "ui/compositor/layer_animator.h" | 24 #include "ui/compositor/layer_animator.h" |
| 25 #include "ui/gfx/canvas.h" | 25 #include "ui/gfx/canvas.h" |
| 26 #include "ui/gfx/display.h" |
| 26 #include "ui/gfx/interpolated_transform.h" | 27 #include "ui/gfx/interpolated_transform.h" |
| 27 #include "ui/gfx/point3.h" | 28 #include "ui/gfx/point3.h" |
| 28 #include "ui/gfx/monitor.h" | |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 const float EPSILON = 1e-3f; | 32 const float EPSILON = 1e-3f; |
| 33 | 33 |
| 34 bool IsApproximateMultipleOf(float value, float base) { | 34 bool IsApproximateMultipleOf(float value, float base) { |
| 35 float remainder = fmod(fabs(value), base); | 35 float remainder = fmod(fabs(value), base); |
| 36 return remainder < EPSILON || base - remainder < EPSILON; | 36 return remainder < EPSILON || base - remainder < EPSILON; |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 return; | 666 return; |
| 667 unsigned int color = 0xFF000000; | 667 unsigned int color = 0xFF000000; |
| 668 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; | 668 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; |
| 669 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); | 669 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); |
| 670 if (!opaque) | 670 if (!opaque) |
| 671 color |= 0xFF; | 671 color |= 0xFF; |
| 672 web_layer_.setDebugBorderColor(color); | 672 web_layer_.setDebugBorderColor(color); |
| 673 } | 673 } |
| 674 | 674 |
| 675 } // namespace ui | 675 } // namespace ui |
| OLD | NEW |