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 (layer_bridge_) { | 77 if (layer_bridge_) { |
78 layer_bridge_->BeginDestruction(); | 78 layer_bridge_->BeginDestruction(); |
79 layer_bridge_.Clear(); | 79 layer_bridge_.Clear(); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void operator=(PassRefPtr<Canvas2DLayerBridge> layer_bridge) { | 83 void operator=(PassRefPtr<Canvas2DLayerBridge> layer_bridge) { |
84 ASSERT(!layer_bridge_); | 84 DCHECK(!layer_bridge_); |
85 layer_bridge_ = layer_bridge; | 85 layer_bridge_ = layer_bridge; |
86 } | 86 } |
87 | 87 |
88 Canvas2DLayerBridge* operator->() { return layer_bridge_.Get(); } | 88 Canvas2DLayerBridge* operator->() { return layer_bridge_.Get(); } |
89 Canvas2DLayerBridge* Get() { return layer_bridge_.Get(); } | 89 Canvas2DLayerBridge* Get() { return layer_bridge_.Get(); } |
90 | 90 |
91 private: | 91 private: |
92 RefPtr<Canvas2DLayerBridge> layer_bridge_; | 92 RefPtr<Canvas2DLayerBridge> layer_bridge_; |
93 }; | 93 }; |
94 | 94 |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); | 1386 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); |
1387 ::testing::Mock::VerifyAndClearExpectations(&gl); | 1387 ::testing::Mock::VerifyAndClearExpectations(&gl); |
1388 | 1388 |
1389 EXPECT_CALL(gl, Flush()).Times(1); | 1389 EXPECT_CALL(gl, Flush()).Times(1); |
1390 bridge->FlushGpu(); | 1390 bridge->FlushGpu(); |
1391 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); | 1391 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); |
1392 ::testing::Mock::VerifyAndClearExpectations(&gl); | 1392 ::testing::Mock::VerifyAndClearExpectations(&gl); |
1393 } | 1393 } |
1394 | 1394 |
1395 } // namespace blink | 1395 } // namespace blink |
OLD | NEW |