| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 virtual ~TestLayerDelegate() {} | 162 virtual ~TestLayerDelegate() {} |
| 163 | 163 |
| 164 void AddColor(SkColor color) { | 164 void AddColor(SkColor color) { |
| 165 colors_.push_back(color); | 165 colors_.push_back(color); |
| 166 } | 166 } |
| 167 | 167 |
| 168 const gfx::Size& paint_size() const { return paint_size_; } | 168 const gfx::Size& paint_size() const { return paint_size_; } |
| 169 int color_index() const { return color_index_; } | 169 int color_index() const { return color_index_; } |
| 170 | 170 |
| 171 std::string ToScaleString() const { | 171 std::string ToScaleString() const { |
| 172 return StringPrintf("%.1f %.1f", scale_x_, scale_y_); | 172 return base::StringPrintf("%.1f %.1f", scale_x_, scale_y_); |
| 173 } | 173 } |
| 174 | 174 |
| 175 float device_scale_factor() const { | 175 float device_scale_factor() const { |
| 176 return device_scale_factor_; | 176 return device_scale_factor_; |
| 177 } | 177 } |
| 178 | 178 |
| 179 // Overridden from LayerDelegate: | 179 // Overridden from LayerDelegate: |
| 180 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { | 180 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { |
| 181 gfx::ImageSkiaRep contents = canvas->ExtractImageRep(); | 181 gfx::ImageSkiaRep contents = canvas->ExtractImageRep(); |
| 182 paint_size_ = gfx::Size(contents.pixel_width(), contents.pixel_height()); | 182 paint_size_ = gfx::Size(contents.pixel_width(), contents.pixel_height()); |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 l1->SetOpacity(0.5f); | 1376 l1->SetOpacity(0.5f); |
| 1377 | 1377 |
| 1378 // Change l1's cc::Layer. | 1378 // Change l1's cc::Layer. |
| 1379 l1->SwitchCCLayerForTest(); | 1379 l1->SwitchCCLayerForTest(); |
| 1380 | 1380 |
| 1381 // Ensure that the opacity animation completed. | 1381 // Ensure that the opacity animation completed. |
| 1382 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f); | 1382 EXPECT_FLOAT_EQ(l1->opacity(), 0.5f); |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 } // namespace ui | 1385 } // namespace ui |
| OLD | NEW |