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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11649005: cc: Support anti-aliasing for solid color layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add DrawQuad::AntiAliasing struct. Created 7 years, 11 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 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 gfx::Transform transformToLayerSpace(gfx::Transform::kSkipInitialization); 506 gfx::Transform transformToLayerSpace(gfx::Transform::kSkipInitialization);
507 bool didInvert = rootLayer->screenSpaceTransform().GetInverse(&transformToLa yerSpace); 507 bool didInvert = rootLayer->screenSpaceTransform().GetInverse(&transformToLa yerSpace);
508 DCHECK(didInvert); 508 DCHECK(didInvert);
509 for (Region::Iterator fillRects(fillRegion); fillRects.has_rect(); fillRects .next()) { 509 for (Region::Iterator fillRects(fillRegion); fillRects.has_rect(); fillRects .next()) {
510 // The root layer transform is composed of translations and scales only, 510 // The root layer transform is composed of translations and scales only,
511 // no perspective, so mapping is sufficient (as opposed to projecting). 511 // no perspective, so mapping is sufficient (as opposed to projecting).
512 gfx::Rect layerRect = MathUtil::mapClippedRect(transformToLayerSpace, fi llRects.rect()); 512 gfx::Rect layerRect = MathUtil::mapClippedRect(transformToLayerSpace, fi llRects.rect());
513 // Skip the quad culler and just append the quads directly to avoid 513 // Skip the quad culler and just append the quads directly to avoid
514 // occlusion checks. 514 // occlusion checks.
515 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); 515 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
516 quad->SetNew(sharedQuadState, layerRect, screenBackgroundColor); 516 quad->SetNew(sharedQuadState, layerRect, DrawQuad::AntiAliasing(), scree nBackgroundColor);
517 quadCuller.append(quad.PassAs<DrawQuad>(), appendQuadsData); 517 quadCuller.append(quad.PassAs<DrawQuad>(), appendQuadsData);
518 } 518 }
519 } 519 }
520 520
521 bool LayerTreeHostImpl::calculateRenderPasses(FrameData& frame) 521 bool LayerTreeHostImpl::calculateRenderPasses(FrameData& frame)
522 { 522 {
523 DCHECK(frame.renderPasses.isEmpty()); 523 DCHECK(frame.renderPasses.isEmpty());
524 524
525 if (!canDraw() || !rootLayer()) 525 if (!canDraw() || !rootLayer())
526 return false; 526 return false;
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1703 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1704 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1704 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1705 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1705 if (scrollbarController && scrollbarController->animate(monotonicTime))
1706 m_client->setNeedsRedrawOnImplThread(); 1706 m_client->setNeedsRedrawOnImplThread();
1707 1707
1708 for (size_t i = 0; i < layer->children().size(); ++i) 1708 for (size_t i = 0; i < layer->children().size(); ++i)
1709 animateScrollbarsRecursive(layer->children()[i], time); 1709 animateScrollbarsRecursive(layer->children()[i], time);
1710 } 1710 }
1711 1711
1712 } // namespace cc 1712 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698