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

Side by Side Diff: cc/software_renderer_unittest.cc

Issue 11111005: Remove GraphicsContext3D:: stubs from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/software_renderer.cc ('k') | cc/stubs/Extensions3D.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 6
7 #include "CCRendererSoftware.h" 7 #include "CCRendererSoftware.h"
8 8
9 #include "CCQuadSink.h" 9 #include "CCQuadSink.h"
10 #include "CCRenderPass.h" 10 #include "CCRenderPass.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 { 105 {
106 IntSize outerSize(100, 100); 106 IntSize outerSize(100, 100);
107 int outerPixels = outerSize.width() * outerSize.height(); 107 int outerPixels = outerSize.width() * outerSize.height();
108 IntSize innerSize(98, 98); 108 IntSize innerSize(98, 98);
109 int innerPixels = innerSize.width() * innerSize.height(); 109 int innerPixels = innerSize.width() * innerSize.height();
110 IntRect outerRect(IntPoint(), outerSize); 110 IntRect outerRect(IntPoint(), outerSize);
111 IntRect innerRect(IntPoint(1, 1), innerSize); 111 IntRect innerRect(IntPoint(1, 1), innerSize);
112 setViewportSize(outerSize); 112 setViewportSize(outerSize);
113 initializeRenderer(); 113 initializeRenderer();
114 114
115 CCResourceProvider::ResourceId resourceYellow = resourceProvider()->createRe source(1, outerSize, GraphicsContext3D::RGBA, CCResourceProvider::TextureUsageAn y); 115 CCResourceProvider::ResourceId resourceYellow = resourceProvider()->createRe source(1, outerSize, GL_RGBA, CCResourceProvider::TextureUsageAny);
116 CCResourceProvider::ResourceId resourceCyan = resourceProvider()->createReso urce(1, innerSize, GraphicsContext3D::RGBA, CCResourceProvider::TextureUsageAny) ; 116 CCResourceProvider::ResourceId resourceCyan = resourceProvider()->createReso urce(1, innerSize, GL_RGBA, CCResourceProvider::TextureUsageAny);
117 117
118 SkColor yellow = SK_ColorYELLOW; 118 SkColor yellow = SK_ColorYELLOW;
119 SkColor cyan = SK_ColorCYAN; 119 SkColor cyan = SK_ColorCYAN;
120 scoped_array<SkColor> yellowPixels(new SkColor[outerPixels]); 120 scoped_array<SkColor> yellowPixels(new SkColor[outerPixels]);
121 scoped_array<SkColor> cyanPixels(new SkColor[innerPixels]); 121 scoped_array<SkColor> cyanPixels(new SkColor[innerPixels]);
122 for (int i = 0; i < outerPixels; i++) 122 for (int i = 0; i < outerPixels; i++)
123 yellowPixels[i] = yellow; 123 yellowPixels[i] = yellow;
124 for (int i = 0; i < innerPixels; i++) 124 for (int i = 0; i < innerPixels; i++)
125 cyanPixels[i] = cyan; 125 cyanPixels[i] = cyan;
126 126
(...skipping 20 matching lines...) Expand all
147 scoped_array<SkColor> pixels(new SkColor[deviceViewportSize().width() * devi ceViewportSize().height()]); 147 scoped_array<SkColor> pixels(new SkColor[deviceViewportSize().width() * devi ceViewportSize().height()]);
148 renderer()->getFramebufferPixels(pixels.get(), outerRect); 148 renderer()->getFramebufferPixels(pixels.get(), outerRect);
149 149
150 EXPECT_EQ(SK_ColorYELLOW, pixels[0]); 150 EXPECT_EQ(SK_ColorYELLOW, pixels[0]);
151 EXPECT_EQ(SK_ColorYELLOW, pixels[outerPixels - 1]); 151 EXPECT_EQ(SK_ColorYELLOW, pixels[outerPixels - 1]);
152 EXPECT_EQ(SK_ColorCYAN, pixels[outerSize.width() + 1]); 152 EXPECT_EQ(SK_ColorCYAN, pixels[outerSize.width() + 1]);
153 EXPECT_EQ(SK_ColorCYAN, pixels[outerPixels - outerSize.width() - 2]); 153 EXPECT_EQ(SK_ColorCYAN, pixels[outerPixels - outerSize.width() - 2]);
154 } 154 }
155 155
156 } // namespace 156 } // namespace
OLDNEW
« no previous file with comments | « cc/software_renderer.cc ('k') | cc/stubs/Extensions3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698