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

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

Issue 1401423003: Re-land: ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after
2620 GLenum type; 2620 GLenum type;
2621 GLenum internal_format; 2621 GLenum internal_format;
2622 2622
2623 EXPECT_TRUE( 2623 EXPECT_TRUE(
2624 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr)); 2624 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
2625 EXPECT_EQ(3, width); 2625 EXPECT_EQ(3, width);
2626 EXPECT_EQ(1, height); 2626 EXPECT_EQ(1, height);
2627 EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format)); 2627 EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format));
2628 EXPECT_EQ(static_cast<GLenum>(GL_RGBA), internal_format); 2628 EXPECT_EQ(static_cast<GLenum>(GL_RGBA), internal_format);
2629 EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type); 2629 EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type);
2630 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); 2630 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == nullptr);
2631 2631
2632 // Bind image to texture. 2632 // Bind image to texture.
2633 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor. 2633 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor.
2634 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1); 2634 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1);
2635 EXPECT_TRUE( 2635 EXPECT_TRUE(
2636 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr)); 2636 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
2637 // Image should now be set. 2637 // Image should now be set.
2638 EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); 2638 EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == nullptr);
2639 2639
2640 // Define new texture image. 2640 // Define new texture image.
2641 DoTexImage2D( 2641 DoTexImage2D(
2642 GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2642 GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2643 EXPECT_TRUE( 2643 EXPECT_TRUE(
2644 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr)); 2644 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
2645 // Image should no longer be set. 2645 // Image should no longer be set.
2646 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); 2646 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == nullptr);
2647 } 2647 }
2648 2648
2649 TEST_P(GLES2DecoderTest, BindTexImage2DCHROMIUMCubeMapNotAllowed) { 2649 TEST_P(GLES2DecoderTest, BindTexImage2DCHROMIUMCubeMapNotAllowed) {
2650 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub); 2650 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub);
2651 GetImageManager()->AddImage(image.get(), 1); 2651 GetImageManager()->AddImage(image.get(), 1);
2652 DoBindTexture(GL_TEXTURE_CUBE_MAP, client_texture_id_, kServiceTextureId); 2652 DoBindTexture(GL_TEXTURE_CUBE_MAP, client_texture_id_, kServiceTextureId);
2653 2653
2654 BindTexImage2DCHROMIUM bind_tex_image_2d_cmd; 2654 BindTexImage2DCHROMIUM bind_tex_image_2d_cmd;
2655 bind_tex_image_2d_cmd.Init(GL_TEXTURE_CUBE_MAP, 1); 2655 bind_tex_image_2d_cmd.Init(GL_TEXTURE_CUBE_MAP, 1);
2656 EXPECT_EQ(error::kNoError, ExecuteCmd(bind_tex_image_2d_cmd)); 2656 EXPECT_EQ(error::kNoError, ExecuteCmd(bind_tex_image_2d_cmd));
2657 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 2657 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
2658 } 2658 }
2659 2659
2660 TEST_P(GLES2DecoderTest, OrphanGLImageWithTexImage2D) { 2660 TEST_P(GLES2DecoderTest, OrphanGLImageWithTexImage2D) {
2661 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub); 2661 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub);
2662 GetImageManager()->AddImage(image.get(), 1); 2662 GetImageManager()->AddImage(image.get(), 1);
2663 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 2663 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
2664 2664
2665 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1); 2665 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1);
2666 2666
2667 TextureRef* texture_ref = 2667 TextureRef* texture_ref =
2668 group().texture_manager()->GetTexture(client_texture_id_); 2668 group().texture_manager()->GetTexture(client_texture_id_);
2669 ASSERT_TRUE(texture_ref != NULL); 2669 ASSERT_TRUE(texture_ref != NULL);
2670 Texture* texture = texture_ref->texture(); 2670 Texture* texture = texture_ref->texture();
2671 2671
2672 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get()); 2672 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == image.get());
2673 DoTexImage2D( 2673 DoTexImage2D(
2674 GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2674 GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2675 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); 2675 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == nullptr);
2676 } 2676 }
2677 2677
2678 TEST_P(GLES2DecoderTest, GLImageAttachedAfterSubTexImage2D) { 2678 TEST_P(GLES2DecoderTest, GLImageAttachedAfterSubTexImage2D) {
2679 // Specifically tests that TexSubImage2D is not optimized to TexImage2D 2679 // Specifically tests that TexSubImage2D is not optimized to TexImage2D
2680 // in the presence of image attachments. 2680 // in the presence of image attachments.
2681 ASSERT_FALSE( 2681 ASSERT_FALSE(
2682 feature_info()->workarounds().texsubimage_faster_than_teximage); 2682 feature_info()->workarounds().texsubimage_faster_than_teximage);
2683 2683
2684 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub); 2684 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub);
2685 GetImageManager()->AddImage(image.get(), 1); 2685 GetImageManager()->AddImage(image.get(), 1);
(...skipping 17 matching lines...) Expand all
2703 pixels_shm_id, pixels_shm_offset); 2703 pixels_shm_id, pixels_shm_offset);
2704 2704
2705 // Bind texture to GLImage. 2705 // Bind texture to GLImage.
2706 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1); 2706 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1);
2707 2707
2708 // Check binding. 2708 // Check binding.
2709 TextureRef* texture_ref = 2709 TextureRef* texture_ref =
2710 group().texture_manager()->GetTexture(client_texture_id_); 2710 group().texture_manager()->GetTexture(client_texture_id_);
2711 ASSERT_TRUE(texture_ref != NULL); 2711 ASSERT_TRUE(texture_ref != NULL);
2712 Texture* texture = texture_ref->texture(); 2712 Texture* texture = texture_ref->texture();
2713 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get()); 2713 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == image.get());
2714 2714
2715 // TexSubImage2D should not unbind GLImage. 2715 // TexSubImage2D should not unbind GLImage.
2716 EXPECT_CALL(*gl_, TexSubImage2D(target, level, xoffset, yoffset, width, 2716 EXPECT_CALL(*gl_, TexSubImage2D(target, level, xoffset, yoffset, width,
2717 height, format, type, _)) 2717 height, format, type, _))
2718 .Times(1) 2718 .Times(1)
2719 .RetiresOnSaturation(); 2719 .RetiresOnSaturation();
2720 cmds::TexSubImage2D tex_sub_image_2d_cmd; 2720 cmds::TexSubImage2D tex_sub_image_2d_cmd;
2721 tex_sub_image_2d_cmd.Init(target, level, xoffset, yoffset, width, height, 2721 tex_sub_image_2d_cmd.Init(target, level, xoffset, yoffset, width, height,
2722 format, type, pixels_shm_id, pixels_shm_offset, 2722 format, type, pixels_shm_id, pixels_shm_offset,
2723 internal); 2723 internal);
2724 EXPECT_EQ(error::kNoError, ExecuteCmd(tex_sub_image_2d_cmd)); 2724 EXPECT_EQ(error::kNoError, ExecuteCmd(tex_sub_image_2d_cmd));
2725 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get()); 2725 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == image.get());
2726 } 2726 }
2727 2727
2728 TEST_P(GLES2DecoderTest, GLImageAttachedAfterClearLevel) { 2728 TEST_P(GLES2DecoderTest, GLImageAttachedAfterClearLevel) {
2729 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub); 2729 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub);
2730 GetImageManager()->AddImage(image.get(), 1); 2730 GetImageManager()->AddImage(image.get(), 1);
2731 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 2731 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
2732 2732
2733 GLenum target = GL_TEXTURE_2D; 2733 GLenum target = GL_TEXTURE_2D;
2734 GLint level = 0; 2734 GLint level = 0;
2735 GLint xoffset = 0; 2735 GLint xoffset = 0;
(...skipping 11 matching lines...) Expand all
2747 pixels_shm_id, pixels_shm_offset); 2747 pixels_shm_id, pixels_shm_offset);
2748 2748
2749 // Bind texture to GLImage. 2749 // Bind texture to GLImage.
2750 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1); 2750 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1);
2751 2751
2752 // Check binding. 2752 // Check binding.
2753 TextureRef* texture_ref = 2753 TextureRef* texture_ref =
2754 group().texture_manager()->GetTexture(client_texture_id_); 2754 group().texture_manager()->GetTexture(client_texture_id_);
2755 ASSERT_TRUE(texture_ref != NULL); 2755 ASSERT_TRUE(texture_ref != NULL);
2756 Texture* texture = texture_ref->texture(); 2756 Texture* texture = texture_ref->texture();
2757 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get()); 2757 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == image.get());
2758 2758
2759 // ClearLevel should use glTexSubImage2D to avoid unbinding GLImage. 2759 // ClearLevel should use glTexSubImage2D to avoid unbinding GLImage.
2760 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)) 2760 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId))
2761 .Times(2) 2761 .Times(2)
2762 .RetiresOnSaturation(); 2762 .RetiresOnSaturation();
2763 EXPECT_CALL(*gl_, TexSubImage2D(target, level, xoffset, yoffset, width, 2763 EXPECT_CALL(*gl_, TexSubImage2D(target, level, xoffset, yoffset, width,
2764 height, format, type, _)) 2764 height, format, type, _))
2765 .Times(1) 2765 .Times(1)
2766 .RetiresOnSaturation(); 2766 .RetiresOnSaturation();
2767 GetDecoder()->ClearLevel(texture, target, level, format, type, 0, 0, width, 2767 GetDecoder()->ClearLevel(texture, target, level, format, type, 0, 0, width,
2768 height); 2768 height);
2769 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == image.get()); 2769 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == image.get());
2770 } 2770 }
2771 2771
2772 TEST_P(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) { 2772 TEST_P(GLES2DecoderTest, ReleaseTexImage2DCHROMIUM) {
2773 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 2773 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
2774 DoTexImage2D( 2774 DoTexImage2D(
2775 GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); 2775 GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
2776 TextureRef* texture_ref = 2776 TextureRef* texture_ref =
2777 group().texture_manager()->GetTexture(client_texture_id_); 2777 group().texture_manager()->GetTexture(client_texture_id_);
2778 ASSERT_TRUE(texture_ref != NULL); 2778 ASSERT_TRUE(texture_ref != NULL);
2779 Texture* texture = texture_ref->texture(); 2779 Texture* texture = texture_ref->texture();
2780 EXPECT_EQ(kServiceTextureId, texture->service_id()); 2780 EXPECT_EQ(kServiceTextureId, texture->service_id());
2781 2781
2782 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub); 2782 scoped_refptr<gfx::GLImage> image(new gfx::GLImageStub);
2783 GetImageManager()->AddImage(image.get(), 1); 2783 GetImageManager()->AddImage(image.get(), 1);
2784 EXPECT_FALSE(GetImageManager()->LookupImage(1) == NULL); 2784 EXPECT_FALSE(GetImageManager()->LookupImage(1) == NULL);
2785 2785
2786 GLsizei width; 2786 GLsizei width;
2787 GLsizei height; 2787 GLsizei height;
2788 GLenum type; 2788 GLenum type;
2789 GLenum internal_format; 2789 GLenum internal_format;
2790 2790
2791 EXPECT_TRUE( 2791 EXPECT_TRUE(
2792 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr)); 2792 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
2793 EXPECT_EQ(3, width); 2793 EXPECT_EQ(3, width);
2794 EXPECT_EQ(1, height); 2794 EXPECT_EQ(1, height);
2795 EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format)); 2795 EXPECT_TRUE(texture->GetLevelType(GL_TEXTURE_2D, 0, &type, &internal_format));
2796 EXPECT_EQ(static_cast<GLenum>(GL_RGBA), internal_format); 2796 EXPECT_EQ(static_cast<GLenum>(GL_RGBA), internal_format);
2797 EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type); 2797 EXPECT_EQ(static_cast<GLenum>(GL_UNSIGNED_BYTE), type);
2798 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); 2798 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == nullptr);
2799 2799
2800 // Bind image to texture. 2800 // Bind image to texture.
2801 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor. 2801 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor.
2802 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1); 2802 DoBindTexImage2DCHROMIUM(GL_TEXTURE_2D, 1);
2803 EXPECT_TRUE( 2803 EXPECT_TRUE(
2804 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr)); 2804 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
2805 // Image should now be set. 2805 // Image should now be set.
2806 EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); 2806 EXPECT_FALSE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == nullptr);
2807 2807
2808 // Release image from texture. 2808 // Release image from texture.
2809 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor. 2809 // ScopedGLErrorSuppressor calls GetError on its constructor and destructor.
2810 EXPECT_CALL(*gl_, GetError()) 2810 EXPECT_CALL(*gl_, GetError())
2811 .WillOnce(Return(GL_NO_ERROR)) 2811 .WillOnce(Return(GL_NO_ERROR))
2812 .WillOnce(Return(GL_NO_ERROR)) 2812 .WillOnce(Return(GL_NO_ERROR))
2813 .RetiresOnSaturation(); 2813 .RetiresOnSaturation();
2814 ReleaseTexImage2DCHROMIUM release_tex_image_2d_cmd; 2814 ReleaseTexImage2DCHROMIUM release_tex_image_2d_cmd;
2815 release_tex_image_2d_cmd.Init(GL_TEXTURE_2D, 1); 2815 release_tex_image_2d_cmd.Init(GL_TEXTURE_2D, 1);
2816 EXPECT_EQ(error::kNoError, ExecuteCmd(release_tex_image_2d_cmd)); 2816 EXPECT_EQ(error::kNoError, ExecuteCmd(release_tex_image_2d_cmd));
2817 EXPECT_TRUE( 2817 EXPECT_TRUE(
2818 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr)); 2818 texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr));
2819 // Image should no longer be set. 2819 // Image should no longer be set.
2820 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL); 2820 EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0, nullptr) == nullptr);
2821 } 2821 }
2822 2822
2823 class MockGLImage : public gfx::GLImage { 2823 class MockGLImage : public gfx::GLImage {
2824 public: 2824 public:
2825 MockGLImage() {} 2825 MockGLImage() {}
2826 2826
2827 // Overridden from gfx::GLImage: 2827 // Overridden from gfx::GLImage:
2828 MOCK_METHOD0(GetSize, gfx::Size()); 2828 MOCK_METHOD0(GetSize, gfx::Size());
2829 MOCK_METHOD0(GetInternalFormat, unsigned()); 2829 MOCK_METHOD0(GetInternalFormat, unsigned());
2830 MOCK_METHOD1(Destroy, void(bool)); 2830 MOCK_METHOD1(Destroy, void(bool));
2831 MOCK_METHOD1(BindTexImage, bool(unsigned)); 2831 MOCK_METHOD1(BindTexImage, bool(unsigned));
2832 MOCK_METHOD1(ReleaseTexImage, void(unsigned)); 2832 MOCK_METHOD1(ReleaseTexImage, void(unsigned));
2833 MOCK_METHOD1(CopyTexImage, bool(unsigned));
2833 MOCK_METHOD3(CopyTexSubImage, 2834 MOCK_METHOD3(CopyTexSubImage,
2834 bool(unsigned, const gfx::Point&, const gfx::Rect&)); 2835 bool(unsigned, const gfx::Point&, const gfx::Rect&));
2835 MOCK_METHOD0(WillUseTexImage, void()); 2836 MOCK_METHOD0(WillUseTexImage, void());
2836 MOCK_METHOD0(DidUseTexImage, void()); 2837 MOCK_METHOD0(DidUseTexImage, void());
2837 MOCK_METHOD0(WillModifyTexImage, void()); 2838 MOCK_METHOD0(WillModifyTexImage, void());
2838 MOCK_METHOD0(DidModifyTexImage, void()); 2839 MOCK_METHOD0(DidModifyTexImage, void());
2839 MOCK_METHOD5(ScheduleOverlayPlane, bool(gfx::AcceleratedWidget, 2840 MOCK_METHOD5(ScheduleOverlayPlane, bool(gfx::AcceleratedWidget,
2840 int, 2841 int,
2841 gfx::OverlayTransform, 2842 gfx::OverlayTransform,
2842 const gfx::Rect&, 2843 const gfx::Rect&,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
2979 init.request_depth = true; 2980 init.request_depth = true;
2980 init.bind_generates_resource = true; 2981 init.bind_generates_resource = true;
2981 InitDecoder(init); 2982 InitDecoder(init);
2982 2983
2983 TextureRef* texture_ref = GetTexture(client_texture_id_); 2984 TextureRef* texture_ref = GetTexture(client_texture_id_);
2984 scoped_refptr<MockGLImage> image(new MockGLImage); 2985 scoped_refptr<MockGLImage> image(new MockGLImage);
2985 group().texture_manager()->SetTarget(texture_ref, GL_TEXTURE_EXTERNAL_OES); 2986 group().texture_manager()->SetTarget(texture_ref, GL_TEXTURE_EXTERNAL_OES);
2986 group().texture_manager()->SetLevelInfo(texture_ref, GL_TEXTURE_EXTERNAL_OES, 2987 group().texture_manager()->SetLevelInfo(texture_ref, GL_TEXTURE_EXTERNAL_OES,
2987 0, GL_RGBA, 0, 0, 1, 0, GL_RGBA, 2988 0, GL_RGBA, 0, 0, 1, 0, GL_RGBA,
2988 GL_UNSIGNED_BYTE, gfx::Rect()); 2989 GL_UNSIGNED_BYTE, gfx::Rect());
2989 group().texture_manager()->SetLevelImage( 2990 group().texture_manager()->SetLevelImage(texture_ref, GL_TEXTURE_EXTERNAL_OES,
2990 texture_ref, GL_TEXTURE_EXTERNAL_OES, 0, image.get()); 2991 0, image.get(), Texture::BOUND);
2991 2992
2992 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); 2993 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
2993 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 2994 EXPECT_EQ(GL_NO_ERROR, GetGLError());
2994 2995
2995 SetupSamplerExternalProgram(); 2996 SetupSamplerExternalProgram();
2996 SetupIndexBuffer(); 2997 SetupIndexBuffer();
2997 AddExpectationsForSimulatedAttrib0(kMaxValidIndex + 1, 0); 2998 AddExpectationsForSimulatedAttrib0(kMaxValidIndex + 1, 0);
2998 SetupExpectationsForApplyingDefaultDirtyState(); 2999 SetupExpectationsForApplyingDefaultDirtyState();
2999 EXPECT_TRUE(group().texture_manager()->CanRender(texture_ref)); 3000 EXPECT_TRUE(group().texture_manager()->CanRender(texture_ref));
3000 3001
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
3384 // TODO(gman): CompressedTexSubImage2DImmediate 3385 // TODO(gman): CompressedTexSubImage2DImmediate
3385 3386
3386 // TODO(gman): TexImage2D 3387 // TODO(gman): TexImage2D
3387 3388
3388 // TODO(gman): TexImage2DImmediate 3389 // TODO(gman): TexImage2DImmediate
3389 3390
3390 // TODO(gman): TexSubImage2DImmediate 3391 // TODO(gman): TexSubImage2DImmediate
3391 3392
3392 } // namespace gles2 3393 } // namespace gles2
3393 } // namespace gpu 3394 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698