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/gfx/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" |
| 23 #include "ui/compositor/layer_animator.h" |
22 #include "ui/gfx/canvas.h" | 24 #include "ui/gfx/canvas.h" |
23 #include "ui/gfx/compositor/compositor_switches.h" | |
24 #include "ui/gfx/compositor/layer_animator.h" | |
25 #include "ui/gfx/interpolated_transform.h" | 25 #include "ui/gfx/interpolated_transform.h" |
26 #include "ui/gfx/point3.h" | 26 #include "ui/gfx/point3.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 const float EPSILON = 1e-3f; | 30 const float EPSILON = 1e-3f; |
31 | 31 |
32 bool IsApproximateMultipleOf(float value, float base) { | 32 bool IsApproximateMultipleOf(float value, float base) { |
33 float remainder = fmod(fabs(value), base); | 33 float remainder = fmod(fabs(value), base); |
34 return remainder < EPSILON || base - remainder < EPSILON; | 34 return remainder < EPSILON || base - remainder < EPSILON; |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 return; | 546 return; |
547 unsigned int color = 0xFF000000; | 547 unsigned int color = 0xFF000000; |
548 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; | 548 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; |
549 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); | 549 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); |
550 if (!opaque) | 550 if (!opaque) |
551 color |= 0xFF; | 551 color |= 0xFF; |
552 web_layer_.setDebugBorderColor(color); | 552 web_layer_.setDebugBorderColor(color); |
553 } | 553 } |
554 | 554 |
555 } // namespace ui | 555 } // namespace ui |
OLD | NEW |