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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 explicit HitTestView(bool has_hittest_mask) | 929 explicit HitTestView(bool has_hittest_mask) |
930 : has_hittest_mask_(has_hittest_mask) { | 930 : has_hittest_mask_(has_hittest_mask) { |
931 } | 931 } |
932 virtual ~HitTestView() {} | 932 virtual ~HitTestView() {} |
933 | 933 |
934 protected: | 934 protected: |
935 // Overridden from View: | 935 // Overridden from View: |
936 virtual bool HasHitTestMask() const OVERRIDE { | 936 virtual bool HasHitTestMask() const OVERRIDE { |
937 return has_hittest_mask_; | 937 return has_hittest_mask_; |
938 } | 938 } |
939 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE { | 939 virtual void GetHitTestMask(HitTestSource source, |
| 940 gfx::Path* mask) const OVERRIDE { |
940 DCHECK(has_hittest_mask_); | 941 DCHECK(has_hittest_mask_); |
941 DCHECK(mask); | 942 DCHECK(mask); |
942 | 943 |
943 SkScalar w = SkIntToScalar(width()); | 944 SkScalar w = SkIntToScalar(width()); |
944 SkScalar h = SkIntToScalar(height()); | 945 SkScalar h = SkIntToScalar(height()); |
945 | 946 |
946 // Create a triangular mask within the bounds of this View. | 947 // Create a triangular mask within the bounds of this View. |
947 mask->moveTo(w / 2, 0); | 948 mask->moveTo(w / 2, 0); |
948 mask->lineTo(w, h); | 949 mask->lineTo(w, h); |
949 mask->lineTo(0, h); | 950 mask->lineTo(0, h); |
(...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3194 const std::vector<ui::Layer*>& child_layers_post = root_layer->children(); | 3195 const std::vector<ui::Layer*>& child_layers_post = root_layer->children(); |
3195 ASSERT_EQ(3u, child_layers_post.size()); | 3196 ASSERT_EQ(3u, child_layers_post.size()); |
3196 EXPECT_EQ(v1->layer(), child_layers_post[0]); | 3197 EXPECT_EQ(v1->layer(), child_layers_post[0]); |
3197 EXPECT_EQ(v2->layer(), child_layers_post[1]); | 3198 EXPECT_EQ(v2->layer(), child_layers_post[1]); |
3198 EXPECT_EQ(v1_old_layer, child_layers_post[2]); | 3199 EXPECT_EQ(v1_old_layer, child_layers_post[2]); |
3199 } | 3200 } |
3200 | 3201 |
3201 #endif // USE_AURA | 3202 #endif // USE_AURA |
3202 | 3203 |
3203 } // namespace views | 3204 } // namespace views |
OLD | NEW |