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

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

Issue 1144993004: cc: Make impl-thread property trees handle fixed-position layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@EnablePropertyTreeVerificationOnImpl
Patch Set: Add DCHECK Created 5 years, 6 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 | « no previous file | cc/layers/layer_position_constraint_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/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 if (IsActive()) 1209 if (IsActive())
1210 return gfx::Vector2dF(scroll_offset_->Delta().x(), 1210 return gfx::Vector2dF(scroll_offset_->Delta().x(),
1211 scroll_offset_->Delta().y()); 1211 scroll_offset_->Delta().y());
1212 else 1212 else
1213 return gfx::Vector2dF(scroll_offset_->PendingDelta().get().x(), 1213 return gfx::Vector2dF(scroll_offset_->PendingDelta().get().x(),
1214 scroll_offset_->PendingDelta().get().y()); 1214 scroll_offset_->PendingDelta().get().y());
1215 } 1215 }
1216 1216
1217 void LayerImpl::SetScrollDelta(const gfx::Vector2dF& delta) { 1217 void LayerImpl::SetScrollDelta(const gfx::Vector2dF& delta) {
1218 DCHECK(IsActive()); 1218 DCHECK(IsActive());
1219 DCHECK(scrollable() || delta.IsZero());
1219 SetCurrentScrollOffset(scroll_offset_->ActiveBase() + 1220 SetCurrentScrollOffset(scroll_offset_->ActiveBase() +
1220 gfx::ScrollOffset(delta)); 1221 gfx::ScrollOffset(delta));
1221 } 1222 }
1222 1223
1223 gfx::ScrollOffset LayerImpl::BaseScrollOffset() const { 1224 gfx::ScrollOffset LayerImpl::BaseScrollOffset() const {
1224 if (IsActive()) 1225 if (IsActive())
1225 return scroll_offset_->ActiveBase(); 1226 return scroll_offset_->ActiveBase();
1226 else 1227 else
1227 return scroll_offset_->PendingBase(); 1228 return scroll_offset_->PendingBase();
1228 } 1229 }
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 gfx::Transform scaled_draw_transform = 1682 gfx::Transform scaled_draw_transform =
1682 draw_properties_.target_space_transform; 1683 draw_properties_.target_space_transform;
1683 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1684 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1684 gfx::Size scaled_content_bounds = 1685 gfx::Size scaled_content_bounds =
1685 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); 1686 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale));
1686 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1687 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1687 gfx::Rect(scaled_content_bounds)); 1688 gfx::Rect(scaled_content_bounds));
1688 } 1689 }
1689 1690
1690 } // namespace cc 1691 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698