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

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

Issue 25596002: aura: Use Layer::SetShowPaintedContent to stop showing external content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: layer-showpaintedcontent: Created 7 years, 2 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
« ui/compositor/layer_unittest.cc ('K') | « ui/views/view.h ('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 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 } 1334 }
1335 1335
1336 // Accelerated Painting -------------------------------------------------------- 1336 // Accelerated Painting --------------------------------------------------------
1337 1337
1338 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { 1338 void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) {
1339 // This method should not have the side-effect of creating the layer. 1339 // This method should not have the side-effect of creating the layer.
1340 if (layer()) 1340 if (layer())
1341 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely); 1341 layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely);
1342 } 1342 }
1343 1343
1344 bool View::SetExternalTexture(ui::Texture* texture) {
1345 DCHECK(texture);
1346 SetPaintToLayer(true);
1347
1348 layer()->SetExternalTexture(texture);
1349
1350 // Child views must not paint into the external texture. So make sure each
1351 // child view has its own layer to paint into.
1352 for (Views::iterator i = children_.begin(); i != children_.end(); ++i)
1353 (*i)->SetPaintToLayer(true);
1354
1355 SchedulePaintInRect(GetLocalBounds());
1356 return true;
1357 }
1358
1359 gfx::Vector2d View::CalculateOffsetToAncestorWithLayer( 1344 gfx::Vector2d View::CalculateOffsetToAncestorWithLayer(
1360 ui::Layer** layer_parent) { 1345 ui::Layer** layer_parent) {
1361 if (layer()) { 1346 if (layer()) {
1362 if (layer_parent) 1347 if (layer_parent)
1363 *layer_parent = layer(); 1348 *layer_parent = layer();
1364 return gfx::Vector2d(); 1349 return gfx::Vector2d();
1365 } 1350 }
1366 if (!parent_) 1351 if (!parent_)
1367 return gfx::Vector2d(); 1352 return gfx::Vector2d();
1368 1353
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 // Message the RootView to do the drag and drop. That way if we're removed 2282 // Message the RootView to do the drag and drop. That way if we're removed
2298 // the RootView can detect it and avoid calling us back. 2283 // the RootView can detect it and avoid calling us back.
2299 gfx::Point widget_location(event.location()); 2284 gfx::Point widget_location(event.location());
2300 ConvertPointToWidget(this, &widget_location); 2285 ConvertPointToWidget(this, &widget_location);
2301 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2286 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2302 // WARNING: we may have been deleted. 2287 // WARNING: we may have been deleted.
2303 return true; 2288 return true;
2304 } 2289 }
2305 2290
2306 } // namespace views 2291 } // namespace views
OLDNEW
« ui/compositor/layer_unittest.cc ('K') | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698