| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/html/canvas/CanvasRenderingContext2D.h" | 7 #include "core/html/canvas/CanvasRenderingContext2D.h" |
| 8 | 8 |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/ImageBitmap.h" | 10 #include "core/frame/ImageBitmap.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 void createContext(OpacityMode); | 83 void createContext(OpacityMode); |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 OwnPtr<DummyPageHolder> m_dummyPageHolder; | 86 OwnPtr<DummyPageHolder> m_dummyPageHolder; |
| 87 RefPtrWillBePersistent<HTMLDocument> m_document; | 87 RefPtrWillBePersistent<HTMLDocument> m_document; |
| 88 RefPtrWillBePersistent<HTMLCanvasElement> m_canvasElement; | 88 RefPtrWillBePersistent<HTMLCanvasElement> m_canvasElement; |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 // Pre-canned objects for testing | 91 // Pre-canned objects for testing |
| 92 RefPtrWillBePersistent<ImageData> m_fullImageData; | 92 Persistent<ImageData> m_fullImageData; |
| 93 RefPtrWillBePersistent<ImageData> m_partialImageData; | 93 Persistent<ImageData> m_partialImageData; |
| 94 FakeImageSource m_opaqueBitmap; | 94 FakeImageSource m_opaqueBitmap; |
| 95 FakeImageSource m_alphaBitmap; | 95 FakeImageSource m_alphaBitmap; |
| 96 StringOrCanvasGradientOrCanvasPattern m_opaqueGradient; | 96 StringOrCanvasGradientOrCanvasPattern m_opaqueGradient; |
| 97 StringOrCanvasGradientOrCanvasPattern m_alphaGradient; | 97 StringOrCanvasGradientOrCanvasPattern m_alphaGradient; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 CanvasRenderingContext2DTest::CanvasRenderingContext2DTest() | 100 CanvasRenderingContext2DTest::CanvasRenderingContext2DTest() |
| 101 : m_opaqueBitmap(IntSize(10, 10), OpaqueBitmap) | 101 : m_opaqueBitmap(IntSize(10, 10), OpaqueBitmap) |
| 102 , m_alphaBitmap(IntSize(10, 10), TransparentBitmap) | 102 , m_alphaBitmap(IntSize(10, 10), TransparentBitmap) |
| 103 { } | 103 { } |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 // The canvasChanged notification must be immediate, and not deferred until
paint time | 598 // The canvasChanged notification must be immediate, and not deferred until
paint time |
| 599 // because offscreen canvases, which are not painted, also need to emit noti
fications. | 599 // because offscreen canvases, which are not painted, also need to emit noti
fications. |
| 600 EXPECT_CALL(*observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1)
)).Times(1); | 600 EXPECT_CALL(*observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1)
)).Times(1); |
| 601 context2d()->fillRect(0, 0, 1, 1); | 601 context2d()->fillRect(0, 0, 1, 1); |
| 602 Mock::VerifyAndClearExpectations(observer.get()); | 602 Mock::VerifyAndClearExpectations(observer.get()); |
| 603 | 603 |
| 604 canvasElement().removeObserver(observer.get()); | 604 canvasElement().removeObserver(observer.get()); |
| 605 } | 605 } |
| 606 | 606 |
| 607 } // unnamed namespace | 607 } // unnamed namespace |
| OLD | NEW |