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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 }; | 54 }; |
55 | 55 |
56 class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge { | 56 class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge { |
57 public: | 57 public: |
58 static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D>
context, PassRefPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode) | 58 static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D>
context, PassRefPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode) |
59 { | 59 { |
60 return adoptRef(static_cast<Canvas2DLayerBridge*>(new FakeCanvas2DLayerB
ridge(context, canvas, opacityMode))); | 60 return adoptRef(static_cast<Canvas2DLayerBridge*>(new FakeCanvas2DLayerB
ridge(context, canvas, opacityMode))); |
61 } | 61 } |
62 protected: | 62 protected: |
63 FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassRefPtr<Sk
DeferredCanvas> canvas, OpacityMode opacityMode) : | 63 FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassRefPtr<Sk
DeferredCanvas> canvas, OpacityMode opacityMode) : |
64 Canvas2DLayerBridge(context, canvas, opacityMode) | 64 Canvas2DLayerBridge(context, canvas, 0, opacityMode) |
65 { } | 65 { } |
66 }; | 66 }; |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 class Canvas2DLayerBridgeTest : public Test { | 70 class Canvas2DLayerBridgeTest : public Test { |
71 protected: | 71 protected: |
72 void fullLifecycleTest() | 72 void fullLifecycleTest() |
73 { | 73 { |
74 RefPtr<GraphicsContext3D> mainContext = GraphicsContext3D::createGraphic
sContextFromWebContext(adoptPtr(new MockCanvasContext)); | 74 RefPtr<GraphicsContext3D> mainContext = GraphicsContext3D::createGraphic
sContextFromWebContext(adoptPtr(new MockCanvasContext)); |
(...skipping 21 matching lines...) Expand all Loading... |
96 }; | 96 }; |
97 | 97 |
98 namespace { | 98 namespace { |
99 | 99 |
100 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded) | 100 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded) |
101 { | 101 { |
102 fullLifecycleTest(); | 102 fullLifecycleTest(); |
103 } | 103 } |
104 | 104 |
105 } // namespace | 105 } // namespace |
OLD | NEW |