OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/layer_tree_host_impl.h" | 7 #include "cc/layer_tree_host_impl.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2531 private: | 2531 private: |
2532 base::hash_set<unsigned> m_allocatedTextureIds; | 2532 base::hash_set<unsigned> m_allocatedTextureIds; |
2533 }; | 2533 }; |
2534 | 2534 |
2535 // Fake video frame that represents a 4x4 YUV video frame. | 2535 // Fake video frame that represents a 4x4 YUV video frame. |
2536 class FakeVideoFrame: public WebVideoFrame { | 2536 class FakeVideoFrame: public WebVideoFrame { |
2537 public: | 2537 public: |
2538 FakeVideoFrame() : m_textureId(0) { memset(m_data, 0x80, sizeof(m_data)); } | 2538 FakeVideoFrame() : m_textureId(0) { memset(m_data, 0x80, sizeof(m_data)); } |
2539 virtual ~FakeVideoFrame() { } | 2539 virtual ~FakeVideoFrame() { } |
2540 virtual Format format() const { return m_textureId ? FormatNativeTexture : F ormatYV12; } | 2540 virtual Format format() const { return m_textureId ? FormatNativeTexture : F ormatYV12; } |
2541 virtual unsigned width() const { return 4; } | |
2542 virtual unsigned height() const { return 4; } | |
2543 virtual unsigned planes() const { return m_textureId ? 0 : 3; } | 2541 virtual unsigned planes() const { return m_textureId ? 0 : 3; } |
2544 virtual int stride(unsigned plane) const { return 4; } | |
2545 virtual const void* data(unsigned plane) const { return m_data; } | 2542 virtual const void* data(unsigned plane) const { return m_data; } |
2546 virtual unsigned textureId() const { return m_textureId; } | 2543 virtual unsigned textureId() const { return m_textureId; } |
2547 virtual unsigned textureTarget() const { return m_textureId ? GL_TEXTURE_2D : 0; } | 2544 virtual unsigned textureTarget() const { return m_textureId ? GL_TEXTURE_2D : 0; } |
2545 virtual unsigned visibleX() const { return 0; } | |
2546 virtual unsigned visibleY() const { return 0; } | |
2547 virtual unsigned visibleWidth() const { return 4; } | |
2548 virtual unsigned visibleHeight() const { return 4; } | |
2549 virtual unsigned textureWidth() const { return 4; } | |
2550 virtual unsigned textureHeight() const { return 4; } | |
2548 | 2551 |
Ami GONE FROM CHROMIUM
2012/10/25 00:43:07
y u no test the interesting case of non-zero offse
sheu
2012/10/25 01:53:54
Done.
| |
2549 void setTextureId(unsigned id) { m_textureId = id; } | 2552 void setTextureId(unsigned id) { m_textureId = id; } |
2550 | 2553 |
2551 private: | 2554 private: |
2552 char m_data[16]; | 2555 char m_data[16]; |
2553 unsigned m_textureId; | 2556 unsigned m_textureId; |
2554 }; | 2557 }; |
2555 | 2558 |
2556 // Fake video frame provider that always provides the same FakeVideoFrame. | 2559 // Fake video frame provider that always provides the same FakeVideoFrame. |
2557 class FakeVideoFrameProvider: public WebVideoFrameProvider { | 2560 class FakeVideoFrameProvider: public WebVideoFrameProvider { |
2558 public: | 2561 public: |
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4375 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat a); | 4378 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat a); |
4376 testCaseIndex++; | 4379 testCaseIndex++; |
4377 } | 4380 } |
4378 } | 4381 } |
4379 | 4382 |
4380 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4383 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
4381 LayerTreeHostImplTest, | 4384 LayerTreeHostImplTest, |
4382 ::testing::Values(false, true)); | 4385 ::testing::Values(false, true)); |
4383 | 4386 |
4384 } // namespace | 4387 } // namespace |
OLD | NEW |