Chromium Code Reviews| 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 "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 7736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7747 CreateHostImpl(DefaultSettings(), FakeOutputSurface::Create3d()); | 7747 CreateHostImpl(DefaultSettings(), FakeOutputSurface::Create3d()); |
| 7748 | 7748 |
| 7749 EXPECT_EQ(0u, context3d->NumTextures()); | 7749 EXPECT_EQ(0u, context3d->NumTextures()); |
| 7750 | 7750 |
| 7751 gfx::Size size(4, 4); | 7751 gfx::Size size(4, 4); |
| 7752 // SkImageInfo has no support for ETC1. The |info| below contains the right | 7752 // SkImageInfo has no support for ETC1. The |info| below contains the right |
| 7753 // total pixel size for the bitmap but not the right height and width. The | 7753 // total pixel size for the bitmap but not the right height and width. The |
| 7754 // correct width/height are passed directly to UIResourceBitmap. | 7754 // correct width/height are passed directly to UIResourceBitmap. |
| 7755 SkImageInfo info = | 7755 SkImageInfo info = |
| 7756 SkImageInfo::Make(4, 2, kAlpha_8_SkColorType, kPremul_SkAlphaType); | 7756 SkImageInfo::Make(4, 2, kAlpha_8_SkColorType, kPremul_SkAlphaType); |
| 7757 skia::RefPtr<SkPixelRef> pixel_ref = | 7757 sk_sp<SkPixelRef> pixel_ref(SkMallocPixelRef::NewAllocate(info, 0, 0)); |
| 7758 skia::AdoptRef(SkMallocPixelRef::NewAllocate(info, 0, 0)); | |
| 7759 pixel_ref->setImmutable(); | 7758 pixel_ref->setImmutable(); |
| 7760 UIResourceBitmap bitmap(pixel_ref, size); | 7759 UIResourceBitmap bitmap(pixel_ref, size); |
|
f(malita)
2016/04/21 15:45:47
move(pixel_ref)
tomhudson
2016/04/25 20:20:51
Done.
| |
| 7761 UIResourceId ui_resource_id = 1; | 7760 UIResourceId ui_resource_id = 1; |
| 7762 host_impl_->CreateUIResource(ui_resource_id, bitmap); | 7761 host_impl_->CreateUIResource(ui_resource_id, bitmap); |
| 7763 EXPECT_EQ(1u, context3d->NumTextures()); | 7762 EXPECT_EQ(1u, context3d->NumTextures()); |
| 7764 ResourceId id1 = host_impl_->ResourceIdForUIResource(ui_resource_id); | 7763 ResourceId id1 = host_impl_->ResourceIdForUIResource(ui_resource_id); |
| 7765 EXPECT_NE(0u, id1); | 7764 EXPECT_NE(0u, id1); |
| 7766 } | 7765 } |
| 7767 | 7766 |
| 7768 void ShutdownReleasesContext_Callback( | 7767 void ShutdownReleasesContext_Callback( |
| 7769 std::unique_ptr<CopyOutputResult> result) {} | 7768 std::unique_ptr<CopyOutputResult> result) {} |
| 7770 | 7769 |
| (...skipping 2902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10673 // There should not be any jitter measured till we hit the fixed point hits | 10672 // There should not be any jitter measured till we hit the fixed point hits |
| 10674 // threshold. | 10673 // threshold. |
| 10675 float expected_jitter = | 10674 float expected_jitter = |
| 10676 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; | 10675 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; |
| 10677 EXPECT_EQ(jitter, expected_jitter); | 10676 EXPECT_EQ(jitter, expected_jitter); |
| 10678 } | 10677 } |
| 10679 } | 10678 } |
| 10680 | 10679 |
| 10681 } // namespace | 10680 } // namespace |
| 10682 } // namespace cc | 10681 } // namespace cc |
| OLD | NEW |