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: cc/layers/texture_layer_unittest.cc

Issue 18796008: Implement shareResources==true in TestWebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also make TestWebGraphicsContext3D default constructor share resources Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/layers/texture_layer.h" 5 #include "cc/layers/texture_layer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "cc/layers/texture_layer_client.h" 10 #include "cc/layers/texture_layer_client.h"
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 : public LayerTreeTest, 875 : public LayerTreeTest,
876 public TextureLayerClient { 876 public TextureLayerClient {
877 public: 877 public:
878 TextureLayerLostContextTest() 878 TextureLayerLostContextTest()
879 : texture_(0), 879 : texture_(0),
880 draw_count_(0) {} 880 draw_count_(0) {}
881 881
882 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { 882 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE {
883 texture_context_ = TestWebGraphicsContext3D::Create(); 883 texture_context_ = TestWebGraphicsContext3D::Create();
884 texture_ = texture_context_->createTexture(); 884 texture_ = texture_context_->createTexture();
885 scoped_ptr<TestWebGraphicsContext3D> context( 885 return CreateFakeOutputSurface();
886 TestWebGraphicsContext3D::Create());
887 return FakeOutputSurface::Create3d(
888 context.PassAs<WebKit::WebGraphicsContext3D>()).PassAs<OutputSurface>();
889 } 886 }
890 887
891 virtual unsigned PrepareTexture() OVERRIDE { 888 virtual unsigned PrepareTexture() OVERRIDE {
892 if (draw_count_ == 0) { 889 if (draw_count_ == 0) {
893 texture_context_->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, 890 texture_context_->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
894 GL_INNOCENT_CONTEXT_RESET_ARB); 891 GL_INNOCENT_CONTEXT_RESET_ARB);
895 } 892 }
896 return texture_; 893 return texture_;
897 } 894 }
898 895
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 scoped_refptr<TextureLayer> texture_layer_; 943 scoped_refptr<TextureLayer> texture_layer_;
947 scoped_ptr<TestWebGraphicsContext3D> texture_context_; 944 scoped_ptr<TestWebGraphicsContext3D> texture_context_;
948 unsigned texture_; 945 unsigned texture_;
949 int draw_count_; 946 int draw_count_;
950 }; 947 };
951 948
952 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerLostContextTest); 949 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerLostContextTest);
953 950
954 } // namespace 951 } // namespace
955 } // namespace cc 952 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/fake_layer_tree_host_client.cc » ('j') | cc/test/test_web_graphics_context_3d.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698