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

Side by Side Diff: ui/compositor/debug_utils.cc

Issue 375693006: Snap layers in views to physical pixel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use cc::MathUtil::Round instead Created 6 years, 5 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 | « no previous file | ui/compositor/dip_util.h » ('j') | ui/compositor/dip_util.cc » ('J')
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/compositor/debug_utils.h" 7 #include "ui/compositor/debug_utils.h"
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <iomanip> 10 #include <iomanip>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 break; 57 break;
58 } 58 }
59 59
60 if (!layer->visible()) 60 if (!layer->visible())
61 *out << L" !visible"; 61 *out << L" !visible";
62 62
63 std::string property_indent_str(indent+3, ' '); 63 std::string property_indent_str(indent+3, ' ');
64 *out << L'\n' << UTF8ToWide(property_indent_str); 64 *out << L'\n' << UTF8ToWide(property_indent_str);
65 *out << L"bounds: " << layer->bounds().x() << L',' << layer->bounds().y(); 65 *out << L"bounds: " << layer->bounds().x() << L',' << layer->bounds().y();
66 *out << L' ' << layer->bounds().width() << L'x' << layer->bounds().height(); 66 *out << L' ' << layer->bounds().width() << L'x' << layer->bounds().height();
67 if (!layer->subpixel_position_offset().IsZero())
68 *out << " " << UTF8ToWide(layer->subpixel_position_offset().ToString());
69
70 const ui::Layer* mask = const_cast<ui::Layer*>(layer)->layer_mask_layer();
71
72 if (mask) {
73 *out << L'\n' << UTF8ToWide(property_indent_str);
74 *out << L"mask layer: " << std::setprecision(2)
75 << UTF8ToWide(mask->bounds().ToString())
76 << UTF8ToWide(mask->subpixel_position_offset().ToString());
77 }
67 78
68 if (layer->opacity() != 1.0f) { 79 if (layer->opacity() != 1.0f) {
69 *out << L'\n' << UTF8ToWide(property_indent_str); 80 *out << L'\n' << UTF8ToWide(property_indent_str);
70 *out << L"opacity: " << std::setprecision(2) << layer->opacity(); 81 *out << L"opacity: " << std::setprecision(2) << layer->opacity();
71 } 82 }
72 83
73 gfx::DecomposedTransform decomp; 84 gfx::DecomposedTransform decomp;
74 if (!layer->transform().IsIdentity() && 85 if (!layer->transform().IsIdentity() &&
75 gfx::DecomposeTransform(&decomp, layer->transform())) { 86 gfx::DecomposeTransform(&decomp, layer->transform())) {
76 *out << L'\n' << UTF8ToWide(property_indent_str); 87 *out << L'\n' << UTF8ToWide(property_indent_str);
(...skipping 21 matching lines...) Expand all
98 109
99 void PrintLayerHierarchy(const Layer* layer, gfx::Point mouse_location) { 110 void PrintLayerHierarchy(const Layer* layer, gfx::Point mouse_location) {
100 std::wostringstream out; 111 std::wostringstream out;
101 out << L"Layer hierarchy:\n"; 112 out << L"Layer hierarchy:\n";
102 PrintLayerHierarchyImp(layer, 0, mouse_location, &out); 113 PrintLayerHierarchyImp(layer, 0, mouse_location, &out);
103 // Error so logs can be collected from end-users. 114 // Error so logs can be collected from end-users.
104 LOG(ERROR) << out.str(); 115 LOG(ERROR) << out.str();
105 } 116 }
106 117
107 } // namespace ui 118 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/compositor/dip_util.h » ('j') | ui/compositor/dip_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698