| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return nullptr; | 148 return nullptr; |
| 149 } | 149 } |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 } // anonymous namespace | 152 } // anonymous namespace |
| 153 | 153 |
| 154 class Canvas2DLayerBridgeTest : public Test { | 154 class Canvas2DLayerBridgeTest : public Test { |
| 155 public: | 155 public: |
| 156 PassRefPtr<Canvas2DLayerBridge> makeBridge(PassOwnPtr<FakeWebGraphicsContext
3DProvider> provider, const IntSize& size, Canvas2DLayerBridge::AccelerationMode
accelerationMode) | 156 PassRefPtr<Canvas2DLayerBridge> makeBridge(PassOwnPtr<FakeWebGraphicsContext
3DProvider> provider, const IntSize& size, Canvas2DLayerBridge::AccelerationMode
accelerationMode) |
| 157 { | 157 { |
| 158 return adoptRef(new Canvas2DLayerBridge(provider, size, 0, NonOpaque, ac
celerationMode)); | 158 return adoptRef(new Canvas2DLayerBridge(std::move(provider), size, 0, No
nOpaque, accelerationMode)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 protected: | 161 protected: |
| 162 void fullLifecycleTest() | 162 void fullLifecycleTest() |
| 163 { | 163 { |
| 164 FakeGLES2Interface gl; | 164 FakeGLES2Interface gl; |
| 165 OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new
FakeWebGraphicsContext3DProvider(&gl)); | 165 OwnPtr<FakeWebGraphicsContext3DProvider> contextProvider = adoptPtr(new
FakeWebGraphicsContext3DProvider(&gl)); |
| 166 | 166 |
| 167 Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextPr
ovider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::DisableA
cceleration))); | 167 Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(contextPr
ovider.release(), IntSize(300, 150), 0, NonOpaque, Canvas2DLayerBridge::DisableA
cceleration))); |
| 168 | 168 |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 WebExternalTextureMailbox mailbox; | 1046 WebExternalTextureMailbox mailbox; |
| 1047 EXPECT_FALSE(bridge->prepareMailbox(&mailbox, 0)); | 1047 EXPECT_FALSE(bridge->prepareMailbox(&mailbox, 0)); |
| 1048 EXPECT_TRUE(bridge->checkSurfaceValid()); | 1048 EXPECT_TRUE(bridge->checkSurfaceValid()); |
| 1049 | 1049 |
| 1050 // Tear down the bridge on the thread so that 'bridge' can go out of scope | 1050 // Tear down the bridge on the thread so that 'bridge' can go out of scope |
| 1051 // without crashing due to thread checks | 1051 // without crashing due to thread checks |
| 1052 postAndWaitDestroyBridgeTask(BLINK_FROM_HERE, testThread.get(), &bridge); | 1052 postAndWaitDestroyBridgeTask(BLINK_FROM_HERE, testThread.get(), &bridge); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 } // namespace blink | 1055 } // namespace blink |
| OLD | NEW |