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

Side by Side Diff: cc/solid_color_layer_impl.cc

Issue 11411050: cc: Make the DrawQuad subclasses into struct-like classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 1 month 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/solid_color_draw_quad.cc ('k') | cc/solid_color_layer_impl_unittest.cc » ('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 "cc/solid_color_layer_impl.h" 5 #include "cc/solid_color_layer_impl.h"
6 6
7 #include "cc/quad_sink.h" 7 #include "cc/quad_sink.h"
8 #include "cc/solid_color_draw_quad.h" 8 #include "cc/solid_color_draw_quad.h"
9 9
10 using WebKit::WebTransformationMatrix; 10 using WebKit::WebTransformationMatrix;
(...skipping 15 matching lines...) Expand all
26 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState()); 26 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState());
27 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); 27 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData);
28 28
29 // We create a series of smaller quads instead of just one large one so that the 29 // We create a series of smaller quads instead of just one large one so that the
30 // culler can reduce the total pixels drawn. 30 // culler can reduce the total pixels drawn.
31 int width = contentBounds().width(); 31 int width = contentBounds().width();
32 int height = contentBounds().height(); 32 int height = contentBounds().height();
33 for (int x = 0; x < width; x += m_tileSize) { 33 for (int x = 0; x < width; x += m_tileSize) {
34 for (int y = 0; y < height; y += m_tileSize) { 34 for (int y = 0; y < height; y += m_tileSize) {
35 gfx::Rect solidTileRect(x, y, std::min(width - x, m_tileSize), std:: min(height - y, m_tileSize)); 35 gfx::Rect solidTileRect(x, y, std::min(width - x, m_tileSize), std:: min(height - y, m_tileSize));
36 quadSink.append(SolidColorDrawQuad::create(sharedQuadState, solidTil eRect, backgroundColor()).PassAs<DrawQuad>(), appendQuadsData); 36 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
37 quad->SetNew(sharedQuadState, solidTileRect, backgroundColor());
38 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
37 } 39 }
38 } 40 }
39 } 41 }
40 42
41 const char* SolidColorLayerImpl::layerTypeAsString() const 43 const char* SolidColorLayerImpl::layerTypeAsString() const
42 { 44 {
43 return "SolidColorLayer"; 45 return "SolidColorLayer";
44 } 46 }
45 47
46 } // namespace cc 48 } // namespace cc
OLDNEW
« no previous file with comments | « cc/solid_color_draw_quad.cc ('k') | cc/solid_color_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698