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

Side by Side Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11649005: cc: Support anti-aliasing for solid color layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: per edge anti-aliasing Created 8 years 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 public: 2144 public:
2145 static scoped_ptr<LayerImpl> create(LayerTreeImpl* treeImpl, int id) { retur n scoped_ptr<LayerImpl>(new FakeLayerWithQuads(treeImpl, id)); } 2145 static scoped_ptr<LayerImpl> create(LayerTreeImpl* treeImpl, int id) { retur n scoped_ptr<LayerImpl>(new FakeLayerWithQuads(treeImpl, id)); }
2146 2146
2147 virtual void appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuadsDat a) OVERRIDE 2147 virtual void appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuadsDat a) OVERRIDE
2148 { 2148 {
2149 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSha redQuadState()); 2149 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSha redQuadState());
2150 2150
2151 SkColor gray = SkColorSetRGB(100, 100, 100); 2151 SkColor gray = SkColorSetRGB(100, 100, 100);
2152 gfx::Rect quadRect(gfx::Point(0, 0), contentBounds()); 2152 gfx::Rect quadRect(gfx::Point(0, 0), contentBounds());
2153 scoped_ptr<SolidColorDrawQuad> myQuad = SolidColorDrawQuad::Create(); 2153 scoped_ptr<SolidColorDrawQuad> myQuad = SolidColorDrawQuad::Create();
2154 myQuad->SetNew(sharedQuadState, quadRect, gray); 2154 myQuad->SetNew(sharedQuadState, quadRect, gray, false, false, false, fal se);
2155 quadSink.append(myQuad.PassAs<DrawQuad>(), appendQuadsData); 2155 quadSink.append(myQuad.PassAs<DrawQuad>(), appendQuadsData);
2156 } 2156 }
2157 2157
2158 private: 2158 private:
2159 FakeLayerWithQuads(LayerTreeImpl* treeImpl, int id) 2159 FakeLayerWithQuads(LayerTreeImpl* treeImpl, int id)
2160 : LayerImpl(treeImpl, id) 2160 : LayerImpl(treeImpl, id)
2161 { 2161 {
2162 } 2162 }
2163 }; 2163 };
2164 2164
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after
4171 if (!testData.renderPassCache.contains(renderPassId)) 4171 if (!testData.renderPassCache.contains(renderPassId))
4172 isReplica = true; 4172 isReplica = true;
4173 4173
4174 scoped_ptr<TestRenderPass> renderPass = testData.renderPassCache.take(re nderPassId); 4174 scoped_ptr<TestRenderPass> renderPass = testData.renderPassCache.take(re nderPassId);
4175 4175
4176 // Cycle through quad data and create all quads 4176 // Cycle through quad data and create all quads
4177 while (*currentChar && *currentChar != '\n') { 4177 while (*currentChar && *currentChar != '\n') {
4178 if (*currentChar == 's') { 4178 if (*currentChar == 's') {
4179 // Solid color draw quad 4179 // Solid color draw quad
4180 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create (); 4180 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create ();
4181 quad->SetNew(testData.sharedQuadState.get(), gfx::Rect(0, 0, 10, 10), SK_ColorWHITE); 4181 quad->SetNew(testData.sharedQuadState.get(), gfx::Rect(0, 0, 10, 10), SK_ColorWHITE, false, false, false, false);
4182 4182
4183 renderPass->AppendQuad(quad.PassAs<DrawQuad>()); 4183 renderPass->AppendQuad(quad.PassAs<DrawQuad>());
4184 currentChar++; 4184 currentChar++;
4185 } else if ((*currentChar >= 'A') && (*currentChar <= 'Z')) { 4185 } else if ((*currentChar >= 'A') && (*currentChar <= 'Z')) {
4186 // RenderPass draw quad 4186 // RenderPass draw quad
4187 int layerId = *currentChar; 4187 int layerId = *currentChar;
4188 currentChar++; 4188 currentChar++;
4189 ASSERT_TRUE(currentChar); 4189 ASSERT_TRUE(currentChar);
4190 int index = *currentChar; 4190 int index = *currentChar;
4191 currentChar++; 4191 currentChar++;
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
4843 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize()); 4843 gfx::Rect noDamage = gfx::Rect(m_hostImpl->deviceViewportSize());
4844 drawFrameAndTestDamage(noDamage); 4844 drawFrameAndTestDamage(noDamage);
4845 } 4845 }
4846 4846
4847 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, 4847 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests,
4848 LayerTreeHostImplTest, 4848 LayerTreeHostImplTest,
4849 ::testing::Values(false, true)); 4849 ::testing::Values(false, true));
4850 4850
4851 } // namespace 4851 } // namespace
4852 } // namespace cc 4852 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/picture_layer_impl.cc » ('j') | cc/solid_color_draw_quad.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698