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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 ~Canvas2DLayerBridgePtr() { clear(); } | 74 ~Canvas2DLayerBridgePtr() { clear(); } |
75 | 75 |
76 void clear() { | 76 void clear() { |
77 if (m_layerBridge) { | 77 if (m_layerBridge) { |
78 m_layerBridge->beginDestruction(); | 78 m_layerBridge->beginDestruction(); |
79 m_layerBridge.clear(); | 79 m_layerBridge.clear(); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void operator=(PassRefPtr<Canvas2DLayerBridge> layerBridge) { | 83 void operator=(PassRefPtr<Canvas2DLayerBridge> layerBridge) { |
84 ASSERT(!m_layerBridge); | 84 DCHECK(!m_layerBridge); |
85 m_layerBridge = layerBridge; | 85 m_layerBridge = layerBridge; |
86 } | 86 } |
87 | 87 |
88 Canvas2DLayerBridge* operator->() { return m_layerBridge.get(); } | 88 Canvas2DLayerBridge* operator->() { return m_layerBridge.get(); } |
89 Canvas2DLayerBridge* get() { return m_layerBridge.get(); } | 89 Canvas2DLayerBridge* get() { return m_layerBridge.get(); } |
90 | 90 |
91 private: | 91 private: |
92 RefPtr<Canvas2DLayerBridge> m_layerBridge; | 92 RefPtr<Canvas2DLayerBridge> m_layerBridge; |
93 }; | 93 }; |
94 | 94 |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 EXPECT_FALSE(bridge->hasRecordedDrawCommands()); | 1368 EXPECT_FALSE(bridge->hasRecordedDrawCommands()); |
1369 ::testing::Mock::VerifyAndClearExpectations(&gl); | 1369 ::testing::Mock::VerifyAndClearExpectations(&gl); |
1370 | 1370 |
1371 EXPECT_CALL(gl, Flush()).Times(1); | 1371 EXPECT_CALL(gl, Flush()).Times(1); |
1372 bridge->flushGpu(); | 1372 bridge->flushGpu(); |
1373 EXPECT_FALSE(bridge->hasRecordedDrawCommands()); | 1373 EXPECT_FALSE(bridge->hasRecordedDrawCommands()); |
1374 ::testing::Mock::VerifyAndClearExpectations(&gl); | 1374 ::testing::Mock::VerifyAndClearExpectations(&gl); |
1375 } | 1375 } |
1376 | 1376 |
1377 } // namespace blink | 1377 } // namespace blink |
OLD | NEW |