Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc

Issue 976063002: Cherry pick fix for bug 461847. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2272
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" 9 #include "gpu/command_buffer/common/gles2_cmd_format.h"
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 GL_RGBA, 1796 GL_RGBA,
1797 GL_UNSIGNED_BYTE, 1797 GL_UNSIGNED_BYTE,
1798 2, 1798 2,
1799 2); 1799 2);
1800 EXPECT_CALL(*gl_, CopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1)) 1800 EXPECT_CALL(*gl_, CopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1))
1801 .Times(1) 1801 .Times(1)
1802 .RetiresOnSaturation(); 1802 .RetiresOnSaturation();
1803 CopyTexSubImage2D cmd; 1803 CopyTexSubImage2D cmd;
1804 cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1); 1804 cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1);
1805 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1805 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1806
1807 TextureManager* manager = group().texture_manager();
1808 TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
1809 ASSERT_TRUE(texture_ref != NULL);
1810 Texture* texture = texture_ref->texture();
1811 EXPECT_TRUE(texture->SafeToRenderFrom());
1812 }
1813
1814 TEST_P(GLES2DecoderTest, CopyTexSubImage2DClearsUnclearedBackBufferSizedTexture) {
1815 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
1816 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kBackBufferWidth, kBackBufferHeight,
1817 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
1818
1819 EXPECT_CALL(*gl_, CopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0,
1820 kBackBufferWidth, kBackBufferHeight))
1821 .Times(1)
1822 .RetiresOnSaturation();
1823 CopyTexSubImage2D cmd;
1824 cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 0, 0, kBackBufferWidth, kBackBufferHeight);
1825 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1826
1827 TextureManager* manager = group().texture_manager();
1828 TextureRef* texture_ref = manager->GetTexture(client_texture_id_);
1829 ASSERT_TRUE(texture_ref != NULL);
1830 Texture* texture = texture_ref->texture();
1831 EXPECT_TRUE(texture->SafeToRenderFrom());
1806 } 1832 }
1807 1833
1808 TEST_P(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) { 1834 TEST_P(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) {
1809 InitState init; 1835 InitState init;
1810 init.extensions = "GL_EXT_texture_compression_s3tc"; 1836 init.extensions = "GL_EXT_texture_compression_s3tc";
1811 init.gl_version = "3.0"; 1837 init.gl_version = "3.0";
1812 init.bind_generates_resource = true; 1838 init.bind_generates_resource = true;
1813 InitDecoder(init); 1839 InitDecoder(init);
1814 1840
1815 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 1841 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 // TODO(gman): CompressedTexSubImage2DImmediate 2859 // TODO(gman): CompressedTexSubImage2DImmediate
2834 2860
2835 // TODO(gman): TexImage2D 2861 // TODO(gman): TexImage2D
2836 2862
2837 // TODO(gman): TexImage2DImmediate 2863 // TODO(gman): TexImage2DImmediate
2838 2864
2839 // TODO(gman): TexSubImage2DImmediate 2865 // TODO(gman): TexSubImage2DImmediate
2840 2866
2841 } // namespace gles2 2867 } // namespace gles2
2842 } // namespace gpu 2868 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698