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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 189433003: Remove --background-color-instead-of-checkerboard flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: backgroundcolorinsteadofcheckerboard: Created 6 years, 9 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 | « cc/layers/layer_impl.h ('k') | cc/layers/layer_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/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/animation/animation_registrar.h" 10 #include "cc/animation/animation_registrar.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 if (max_scroll_offset.x() <= 0 && max_scroll_offset.y() <= 0) { 455 if (max_scroll_offset.x() <= 0 && max_scroll_offset.y() <= 0) {
456 TRACE_EVENT0("cc", 456 TRACE_EVENT0("cc",
457 "LayerImpl::tryScroll: Ignored. Technically scrollable," 457 "LayerImpl::tryScroll: Ignored. Technically scrollable,"
458 " but has no affordance in either direction."); 458 " but has no affordance in either direction.");
459 return InputHandler::ScrollIgnored; 459 return InputHandler::ScrollIgnored;
460 } 460 }
461 461
462 return InputHandler::ScrollStarted; 462 return InputHandler::ScrollStarted;
463 } 463 }
464 464
465 bool LayerImpl::DrawCheckerboardForMissingTiles() const {
466 return draw_checkerboard_for_missing_tiles_ &&
467 !layer_tree_impl()->settings().background_color_instead_of_checkerboard;
468 }
469
470 gfx::Rect LayerImpl::LayerRectToContentRect( 465 gfx::Rect LayerImpl::LayerRectToContentRect(
471 const gfx::RectF& layer_rect) const { 466 const gfx::RectF& layer_rect) const {
472 gfx::RectF content_rect = 467 gfx::RectF content_rect =
473 gfx::ScaleRect(layer_rect, contents_scale_x(), contents_scale_y()); 468 gfx::ScaleRect(layer_rect, contents_scale_x(), contents_scale_y());
474 // Intersect with content rect to avoid the extra pixel because for some 469 // Intersect with content rect to avoid the extra pixel because for some
475 // values x and y, ceil((x / y) * y) may be x + 1. 470 // values x and y, ceil((x / y) * y) may be x + 1.
476 content_rect.Intersect(gfx::Rect(content_bounds())); 471 content_rect.Intersect(gfx::Rect(content_bounds()));
477 return gfx::ToEnclosingRect(content_rect); 472 return gfx::ToEnclosingRect(content_rect);
478 } 473 }
479 474
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 scoped_ptr<base::Value> LayerImpl::AsValue() const { 1491 scoped_ptr<base::Value> LayerImpl::AsValue() const {
1497 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1492 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1498 AsValueInto(state.get()); 1493 AsValueInto(state.get());
1499 return state.PassAs<base::Value>(); 1494 return state.PassAs<base::Value>();
1500 } 1495 }
1501 1496
1502 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1497 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1503 benchmark->RunOnLayer(this); 1498 benchmark->RunOnLayer(this);
1504 } 1499 }
1505 } // namespace cc 1500 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698