Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "gpu/command_buffer/service/error_state_mock.h" | 8 #include "gpu/command_buffer/service/error_state_mock.h" |
| 9 #include "gpu/command_buffer/service/feature_info.h" | 9 #include "gpu/command_buffer/service/feature_info.h" |
| 10 #include "gpu/command_buffer/service/framebuffer_manager.h" | 10 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| (...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1484 GL_TEXTURE_WRAP_S, | 1484 GL_TEXTURE_WRAP_S, |
| 1485 GL_REPEAT, | 1485 GL_REPEAT, |
| 1486 GL_NO_ERROR); | 1486 GL_NO_ERROR); |
| 1487 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); | 1487 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); |
| 1488 | 1488 |
| 1489 // Check Unbinding does not call CheckFramebufferStatus | 1489 // Check Unbinding does not call CheckFramebufferStatus |
| 1490 framebuffer_->UnbindRenderbuffer(GL_RENDERBUFFER, renderbuffer1); | 1490 framebuffer_->UnbindRenderbuffer(GL_RENDERBUFFER, renderbuffer1); |
| 1491 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); | 1491 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); |
| 1492 } | 1492 } |
| 1493 | 1493 |
| 1494 TEST_F(FramebufferInfoTest, HasDuplicateColorAttachments) { | |
|
Zhenyao Mo
2016/07/19 20:39:15
nit: HasDuplicatedAttachments
qiankun
2016/07/20 08:53:33
Done.
| |
| 1495 const GLuint kTextureClientId = 33; | |
| 1496 const GLuint kTextureServiceId = 333; | |
| 1497 const GLenum kTarget = GL_TEXTURE_2D; | |
| 1498 const GLint kLevel = 0; | |
| 1499 const GLint kSamples = 0; | |
| 1500 | |
| 1501 texture_manager_->CreateTexture(kTextureClientId, kTextureServiceId); | |
| 1502 scoped_refptr<TextureRef> texture( | |
| 1503 texture_manager_->GetTexture(kTextureClientId)); | |
| 1504 ASSERT_TRUE(texture.get() != NULL); | |
|
Zhenyao Mo
2016/07/19 20:39:15
nit: nullptr
qiankun
2016/07/20 08:53:33
Done.
BTW:
These are many "NULL" under src/gpu/.
| |
| 1505 texture_manager_->SetTarget(texture.get(), GL_TEXTURE_2D); | |
| 1506 | |
| 1507 // Check an image is attached to more than one color attachment point | |
| 1508 // in a framebuffer. | |
| 1509 framebuffer_->AttachTexture( | |
| 1510 GL_COLOR_ATTACHMENT0, texture.get(), kTarget, kLevel, kSamples); | |
| 1511 framebuffer_->AttachTexture( | |
| 1512 GL_COLOR_ATTACHMENT1, texture.get(), kTarget, kLevel, kSamples); | |
| 1513 EXPECT_TRUE(framebuffer_->HasDuplicateColorAttachments()); | |
| 1514 } | |
| 1515 | |
| 1494 class FramebufferInfoES3Test : public FramebufferInfoTestBase { | 1516 class FramebufferInfoES3Test : public FramebufferInfoTestBase { |
| 1495 public: | 1517 public: |
| 1496 FramebufferInfoES3Test() : FramebufferInfoTestBase(CONTEXT_TYPE_WEBGL2) {} | 1518 FramebufferInfoES3Test() : FramebufferInfoTestBase(CONTEXT_TYPE_WEBGL2) {} |
| 1497 }; | 1519 }; |
| 1498 | 1520 |
| 1499 TEST_F(FramebufferInfoES3Test, DifferentDimensions) { | 1521 TEST_F(FramebufferInfoES3Test, DifferentDimensions) { |
| 1500 const GLuint kRenderbufferClient1Id = 33; | 1522 const GLuint kRenderbufferClient1Id = 33; |
| 1501 const GLuint kRenderbufferService1Id = 333; | 1523 const GLuint kRenderbufferService1Id = 333; |
| 1502 const GLuint kRenderbufferClient2Id = 34; | 1524 const GLuint kRenderbufferClient2Id = 34; |
| 1503 const GLuint kRenderbufferService2Id = 334; | 1525 const GLuint kRenderbufferService2Id = 334; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1557 renderbuffer_manager_->GetRenderbuffer(kRenderbufferClientId); | 1579 renderbuffer_manager_->GetRenderbuffer(kRenderbufferClientId); |
| 1558 ASSERT_TRUE(renderbuffer != NULL); | 1580 ASSERT_TRUE(renderbuffer != NULL); |
| 1559 framebuffer_->AttachRenderbuffer(GL_COLOR_ATTACHMENT1, renderbuffer); | 1581 framebuffer_->AttachRenderbuffer(GL_COLOR_ATTACHMENT1, renderbuffer); |
| 1560 EXPECT_TRUE(framebuffer_->GetReadBufferAttachment()); | 1582 EXPECT_TRUE(framebuffer_->GetReadBufferAttachment()); |
| 1561 } | 1583 } |
| 1562 | 1584 |
| 1563 } // namespace gles2 | 1585 } // namespace gles2 |
| 1564 } // namespace gpu | 1586 } // namespace gpu |
| 1565 | 1587 |
| 1566 | 1588 |
| OLD | NEW |