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

Side by Side Diff: ui/views/view.cc

Issue 2230513005: Move visual rect unioning between paired items to cc::DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback. Created 4 years, 4 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
« no previous file with comments | « ui/compositor/transform_recorder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 819
820 ui::TransformRecorder transform_recorder(context); 820 ui::TransformRecorder transform_recorder(context);
821 if (paint_relative_to_parent) { 821 if (paint_relative_to_parent) {
822 // Translate the graphics such that 0,0 corresponds to where 822 // Translate the graphics such that 0,0 corresponds to where
823 // this View is located relative to its parent. 823 // this View is located relative to its parent.
824 gfx::Transform transform_from_parent; 824 gfx::Transform transform_from_parent;
825 gfx::Vector2d offset_from_parent = GetMirroredPosition().OffsetFromOrigin(); 825 gfx::Vector2d offset_from_parent = GetMirroredPosition().OffsetFromOrigin();
826 transform_from_parent.Translate(offset_from_parent.x(), 826 transform_from_parent.Translate(offset_from_parent.x(),
827 offset_from_parent.y()); 827 offset_from_parent.y());
828 transform_from_parent.PreconcatTransform(GetTransform()); 828 transform_from_parent.PreconcatTransform(GetTransform());
829 transform_recorder.Transform(transform_from_parent, size()); 829 transform_recorder.Transform(transform_from_parent);
830 } 830 }
831 831
832 // Note that the cache is not aware of the offset of the view 832 // Note that the cache is not aware of the offset of the view
833 // relative to the parent since painting is always done relative to 833 // relative to the parent since painting is always done relative to
834 // the top left of the individual view. 834 // the top left of the individual view.
835 if (is_invalidated || !paint_cache_.UseCache(context, size())) { 835 if (is_invalidated || !paint_cache_.UseCache(context, size())) {
836 ui::PaintRecorder recorder(context, size(), &paint_cache_); 836 ui::PaintRecorder recorder(context, size(), &paint_cache_);
837 gfx::Canvas* canvas = recorder.canvas(); 837 gfx::Canvas* canvas = recorder.canvas();
838 838
839 // If the View we are about to paint requested the canvas to be flipped, we 839 // If the View we are about to paint requested the canvas to be flipped, we
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 // Message the RootView to do the drag and drop. That way if we're removed 2420 // Message the RootView to do the drag and drop. That way if we're removed
2421 // the RootView can detect it and avoid calling us back. 2421 // the RootView can detect it and avoid calling us back.
2422 gfx::Point widget_location(event.location()); 2422 gfx::Point widget_location(event.location());
2423 ConvertPointToWidget(this, &widget_location); 2423 ConvertPointToWidget(this, &widget_location);
2424 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2424 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2425 // WARNING: we may have been deleted. 2425 // WARNING: we may have been deleted.
2426 return true; 2426 return true;
2427 } 2427 }
2428 2428
2429 } // namespace views 2429 } // namespace views
OLDNEW
« no previous file with comments | « ui/compositor/transform_recorder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698