| Index: cc/trees/layer_tree_host_impl.cc
|
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
| index 542143cea7af64c6cfc63ed93ba67bb66b77e5e8..e7829db683edc8a2607aecd7ee2e707e6c388011 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -141,7 +141,7 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient {
|
| time_source));
|
| }
|
| virtual ~LayerTreeHostImplTimeSourceAdapter() {
|
| - time_source_->SetClient(NULL);
|
| + time_source_->SetClient(nullptr);
|
| time_source_->SetActive(false);
|
| }
|
|
|
| @@ -229,14 +229,14 @@ LayerTreeHostImpl::LayerTreeHostImpl(
|
| client_(client),
|
| proxy_(proxy),
|
| use_gpu_rasterization_(false),
|
| - input_handler_client_(NULL),
|
| + input_handler_client_(nullptr),
|
| did_lock_scrolling_layer_(false),
|
| should_bubble_scrolls_(false),
|
| wheel_scrolling_(false),
|
| scroll_affects_scroll_handler_(false),
|
| scroll_layer_id_when_mouse_over_scrollbar_(0),
|
| tile_priorities_dirty_(false),
|
| - root_layer_scroll_offset_delegate_(NULL),
|
| + root_layer_scroll_offset_delegate_(nullptr),
|
| settings_(settings),
|
| visible_(true),
|
| cached_managed_memory_policy_(
|
| @@ -300,7 +300,7 @@ LayerTreeHostImpl::~LayerTreeHostImpl() {
|
|
|
| if (input_handler_client_) {
|
| input_handler_client_->WillShutdown();
|
| - input_handler_client_ = NULL;
|
| + input_handler_client_ = nullptr;
|
| }
|
|
|
| // The layer trees must be destroyed before the layer tree host. We've
|
| @@ -376,7 +376,7 @@ bool LayerTreeHostImpl::CanDraw() const {
|
| return false;
|
| }
|
|
|
| - // Must have an OutputSurface if |renderer_| is not NULL.
|
| + // Must have an OutputSurface if |renderer_| is not nullptr.
|
| DCHECK(output_surface_);
|
|
|
| // TODO(boliu): Make draws without root_layer work and move this below
|
| @@ -451,7 +451,7 @@ bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt(
|
|
|
| bool scroll_on_main_thread = false;
|
| LayerImpl* scrolling_layer_impl = FindScrollLayerForDeviceViewportPoint(
|
| - device_viewport_point, type, layer_impl, &scroll_on_main_thread, NULL);
|
| + device_viewport_point, type, layer_impl, &scroll_on_main_thread, nullptr);
|
| return CurrentlyScrollingLayer() == scrolling_layer_impl;
|
| }
|
|
|
| @@ -465,14 +465,14 @@ bool LayerTreeHostImpl::HaveTouchEventHandlersAt(
|
| active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion(
|
| device_viewport_point);
|
|
|
| - return layer_impl != NULL;
|
| + return layer_impl != nullptr;
|
| }
|
|
|
| scoped_ptr<SwapPromiseMonitor>
|
| LayerTreeHostImpl::CreateLatencyInfoSwapPromiseMonitor(
|
| ui::LatencyInfo* latency) {
|
| return make_scoped_ptr(
|
| - new LatencyInfoSwapPromiseMonitor(latency, NULL, this));
|
| + new LatencyInfoSwapPromiseMonitor(latency, nullptr, this));
|
| }
|
|
|
| void LayerTreeHostImpl::QueueSwapPromiseForMainThreadScrollUpdate(
|
| @@ -716,7 +716,7 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
|
| RenderSurfaceImpl* render_surface = render_surface_layer->render_surface();
|
|
|
| bool should_draw_into_render_pass =
|
| - render_surface_layer->parent() == NULL ||
|
| + render_surface_layer->parent() == nullptr ||
|
| render_surface->contributes_to_drawn_surface() ||
|
| render_surface_layer->HasCopyRequest();
|
| if (should_draw_into_render_pass)
|
| @@ -964,7 +964,7 @@ static inline RenderPass* FindRenderPassById(
|
| const LayerTreeHostImpl::FrameData& frame) {
|
| RenderPassIdHashMap::const_iterator it =
|
| frame.render_passes_by_id.find(render_pass_id);
|
| - return it != frame.render_passes_by_id.end() ? it->second : NULL;
|
| + return it != frame.render_passes_by_id.end() ? it->second : nullptr;
|
| }
|
|
|
| static void RemoveRenderPassesRecursive(RenderPassId remove_render_pass_id,
|
| @@ -1251,7 +1251,7 @@ void LayerTreeHostImpl::GetPictureLayerImplPairs(
|
| // Ignore the twin layer when tile priorities are invalid.
|
| // TODO(vmpstr): Iterators should handle this instead. crbug.com/381704
|
| if (twin_layer && !twin_layer->HasValidTilePriorities())
|
| - twin_layer = NULL;
|
| + twin_layer = nullptr;
|
|
|
| // If the current tree is ACTIVE_TREE, then always generate a layer_pair.
|
| // If current tree is PENDING_TREE, then only generate a layer_pair if
|
| @@ -1260,7 +1260,7 @@ void LayerTreeHostImpl::GetPictureLayerImplPairs(
|
| DCHECK(!twin_layer || twin_layer->GetTree() == PENDING_TREE);
|
| layer_pairs->push_back(PictureLayerImpl::Pair(layer, twin_layer));
|
| } else if (!twin_layer) {
|
| - layer_pairs->push_back(PictureLayerImpl::Pair(NULL, layer));
|
| + layer_pairs->push_back(PictureLayerImpl::Pair(nullptr, layer));
|
| }
|
| }
|
| }
|
| @@ -1547,7 +1547,8 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
|
| IsCurrentlyScrolling() || needs_animate_layers();
|
|
|
| scoped_ptr<SoftwareRenderer> temp_software_renderer =
|
| - SoftwareRenderer::Create(this, &settings_, output_surface_.get(), NULL);
|
| + SoftwareRenderer::Create(
|
| + this, &settings_, output_surface_.get(), nullptr);
|
| temp_software_renderer->DrawFrame(&frame->render_passes,
|
| device_scale_factor_,
|
| DeviceViewport(),
|
| @@ -1714,7 +1715,7 @@ bool LayerTreeHostImpl::IsCurrentlyScrolling() const {
|
| // this function returns the associated scroll layer if any.
|
| static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) {
|
| if (!layer_impl)
|
| - return NULL;
|
| + return nullptr;
|
|
|
| if (layer_impl->scrollable())
|
| return layer_impl;
|
| @@ -1724,7 +1725,7 @@ static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) {
|
| layer_impl->parent()->scrollable())
|
| return layer_impl->parent();
|
|
|
| - return NULL;
|
| + return nullptr;
|
| }
|
|
|
| void LayerTreeHostImpl::CreatePendingTree() {
|
| @@ -1760,7 +1761,7 @@ void LayerTreeHostImpl::ActivateSyncTree() {
|
| if (pending_tree_) {
|
| TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get());
|
|
|
| - active_tree_->SetRootLayerScrollOffsetDelegate(NULL);
|
| + active_tree_->SetRootLayerScrollOffsetDelegate(nullptr);
|
| active_tree_->PushPersistedState(pending_tree_.get());
|
| // Process any requests in the UI resource queue. The request queue is
|
| // given in LayerTreeHost::FinishCommitOnImplThread. This must take place
|
| @@ -2225,7 +2226,7 @@ float LayerTreeHostImpl::ControlsTopOffset() const {
|
| }
|
|
|
| void LayerTreeHostImpl::BindToClient(InputHandlerClient* client) {
|
| - DCHECK(input_handler_client_ == NULL);
|
| + DCHECK(input_handler_client_ == nullptr);
|
| input_handler_client_ = client;
|
| }
|
|
|
| @@ -2244,14 +2245,14 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
|
| DCHECK(scroll_on_main_thread);
|
|
|
| // Walk up the hierarchy and look for a scrollable layer.
|
| - LayerImpl* potentially_scrolling_layer_impl = NULL;
|
| + LayerImpl* potentially_scrolling_layer_impl = nullptr;
|
| for (; layer_impl; layer_impl = NextScrollLayer(layer_impl)) {
|
| // The content layer can also block attempts to scroll outside the main
|
| // thread.
|
| ScrollStatus status = layer_impl->TryScroll(device_viewport_point, type);
|
| if (status == ScrollOnMainThread) {
|
| *scroll_on_main_thread = true;
|
| - return NULL;
|
| + return nullptr;
|
| }
|
|
|
| LayerImpl* scroll_layer_impl = FindScrollLayerForContentLayer(layer_impl);
|
| @@ -2262,7 +2263,7 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
|
| // If any layer wants to divert the scroll event to the main thread, abort.
|
| if (status == ScrollOnMainThread) {
|
| *scroll_on_main_thread = true;
|
| - return NULL;
|
| + return nullptr;
|
| }
|
|
|
| if (optional_has_ancestor_scroll_handler &&
|
| @@ -2694,7 +2695,7 @@ void LayerTreeHostImpl::SetRootLayerScrollOffsetDelegate(
|
| }
|
|
|
| void LayerTreeHostImpl::OnRootLayerDelegatedScrollOffsetChanged() {
|
| - DCHECK(root_layer_scroll_offset_delegate_ != NULL);
|
| + DCHECK(root_layer_scroll_offset_delegate_ != nullptr);
|
| client_->SetNeedsCommitOnImplThread();
|
| active_tree_->set_needs_update_draw_properties();
|
| }
|
| @@ -2767,7 +2768,7 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
|
| // TODO(wjmaclean) Add a unit test if this fixes the crashes.
|
| ScrollbarAnimationController* animation_controller =
|
| scroll_layer_impl ? scroll_layer_impl->scrollbar_animation_controller()
|
| - : NULL;
|
| + : nullptr;
|
| if (animation_controller)
|
| animation_controller->DidMouseMoveOffScrollbar();
|
| scroll_layer_id_when_mouse_over_scrollbar_ = 0;
|
| @@ -2779,7 +2780,7 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
|
| InputHandler::Gesture,
|
| layer_impl,
|
| &scroll_on_main_thread,
|
| - NULL);
|
| + nullptr);
|
| if (scroll_on_main_thread || !scroll_layer_impl)
|
| return;
|
|
|
| @@ -2846,7 +2847,7 @@ void LayerTreeHostImpl::PinchGestureUpdate(float magnify_delta,
|
| // For a moment the scroll offset ends up being outside of the max range. This
|
| // confuses the delegate so we switch it off till after we're done processing
|
| // the pinch update.
|
| - active_tree_->SetRootLayerScrollOffsetDelegate(NULL);
|
| + active_tree_->SetRootLayerScrollOffsetDelegate(nullptr);
|
|
|
| // Keep the center-of-pinch anchor specified by (x, y) in a stable
|
| // position over the course of the magnify.
|
| @@ -3149,12 +3150,12 @@ BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const {
|
| }
|
|
|
| void LayerTreeHostImpl::AsValueInto(base::debug::TracedValue* value) const {
|
| - return AsValueWithFrameInto(NULL, value);
|
| + return AsValueWithFrameInto(nullptr, value);
|
| }
|
|
|
| scoped_refptr<base::debug::ConvertableToTraceFormat>
|
| LayerTreeHostImpl::AsValue() const {
|
| - return AsValueWithFrame(NULL);
|
| + return AsValueWithFrame(nullptr);
|
| }
|
|
|
| scoped_refptr<base::debug::ConvertableToTraceFormat>
|
|
|