OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCLayerSorter.h" | 7 #include "CCLayerSorter.h" |
8 | 8 |
9 #include "CCMathUtil.h" | 9 #include "CCMathUtil.h" |
10 #include "CCRenderSurface.h" | 10 #include "CCRenderSurface.h" |
11 #include <limits.h> | 11 #include <limits.h> |
12 #include <public/WebTransformationMatrix.h> | 12 #include <public/WebTransformationMatrix.h> |
13 #include <wtf/Deque.h> | 13 #include <wtf/Deque.h> |
14 | 14 |
15 using namespace std; | 15 using namespace std; |
16 using WebKit::WebTransformationMatrix; | 16 using WebKit::WebTransformationMatrix; |
17 | 17 |
18 #define LOG_CHANNEL_PREFIX Log | 18 #define LOG_CHANNEL_PREFIX Log |
19 #define SHOW_DEBUG_LOG 0 | 19 #define SHOW_DEBUG_LOG 0 |
20 | 20 |
21 #if !defined( NDEBUG ) | 21 #if !defined( NDEBUG ) |
22 #if SHOW_DEBUG_LOG | 22 #if SHOW_DEBUG_LOG |
23 static WTFLogChannel LogCCLayerSorter = { 0x00000000, "", WTFLogChannelOn }; | 23 static WTFLogChannel LogCCLayerSorter = { 0x00000000, "", WTFLogChannelOn }; |
24 #else | 24 #else |
25 static WTFLogChannel LogCCLayerSorter = { 0x00000000, "", WTFLogChannelOff }; | 25 static WTFLogChannel LogCCLayerSorter = { 0x00000000, "", WTFLogChannelOff }; |
26 #endif | 26 #endif |
27 #endif | 27 #endif |
28 | 28 |
29 namespace WebCore { | 29 namespace cc { |
30 | 30 |
31 inline static float perpProduct(const FloatSize& u, const FloatSize& v) | 31 inline static float perpProduct(const FloatSize& u, const FloatSize& v) |
32 { | 32 { |
33 return u.width() * v.height() - u.height() * v.width(); | 33 return u.width() * v.height() - u.height() * v.width(); |
34 } | 34 } |
35 | 35 |
36 // Tests if two edges defined by their endpoints (a,b) and (c,d) intersect. Retu
rns true and the | 36 // Tests if two edges defined by their endpoints (a,b) and (c,d) intersect. Retu
rns true and the |
37 // point of intersection if they do and false otherwise. | 37 // point of intersection if they do and false otherwise. |
38 static bool edgeEdgeTest(const FloatPoint& a, const FloatPoint& b, const FloatPo
int& c, const FloatPoint& d, FloatPoint& r) | 38 static bool edgeEdgeTest(const FloatPoint& a, const FloatPoint& b, const FloatPo
int& c, const FloatPoint& d, FloatPoint& r) |
39 { | 39 { |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 #if !defined( NDEBUG ) | 413 #if !defined( NDEBUG ) |
414 LOG(CCLayerSorter, "Sorting end ----\n"); | 414 LOG(CCLayerSorter, "Sorting end ----\n"); |
415 #endif | 415 #endif |
416 | 416 |
417 m_nodes.clear(); | 417 m_nodes.clear(); |
418 m_edges.clear(); | 418 m_edges.clear(); |
419 m_activeEdges.clear(); | 419 m_activeEdges.clear(); |
420 } | 420 } |
421 | 421 |
422 } | 422 } |
OLD | NEW |