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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1135743004: cc: Add null checks for GrContext created by ContextProviderCommandBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Create and check GrContext early in LTHI::InitializeRenderer() Created 5 years, 7 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 resource_provider_ = nullptr; 2159 resource_provider_ = nullptr;
2160 output_surface_ = nullptr; 2160 output_surface_ = nullptr;
2161 2161
2162 if (!output_surface->BindToClient(this)) { 2162 if (!output_surface->BindToClient(this)) {
2163 // Avoid recreating tree resources because we might not have enough 2163 // Avoid recreating tree resources because we might not have enough
2164 // information to do this yet (eg. we don't have a TileManager at this 2164 // information to do this yet (eg. we don't have a TileManager at this
2165 // point). 2165 // point).
2166 return false; 2166 return false;
2167 } 2167 }
2168 2168
2169 if (use_gpu_rasterization_) {
danakj 2015/05/12 23:40:43 This can be changed by CreateAndSetRenderer below
vmiura 2015/05/13 02:53:00 Thanks for spotting this. Hmm, I think it could a
piman 2015/05/13 03:28:36 We can simply rely on settings_.gpu_rasterization_
Stephen White 2015/05/13 10:10:13 In that case, you should probably check settings_.
2170 // Ensure we have a GrContext for GPU rasterization.
2171 ContextProvider* context_provider =
2172 output_surface->worker_context_provider();
2173 if (!context_provider)
piman 2015/05/12 23:33:50 nit: you can probably DCHECK this.
2174 return false;
2175 if (!context_provider->GrContext())
2176 return false;
2177 }
2178
2169 output_surface_ = output_surface.Pass(); 2179 output_surface_ = output_surface.Pass();
2170 resource_provider_ = ResourceProvider::Create( 2180 resource_provider_ = ResourceProvider::Create(
2171 output_surface_.get(), shared_bitmap_manager_, gpu_memory_buffer_manager_, 2181 output_surface_.get(), shared_bitmap_manager_, gpu_memory_buffer_manager_,
2172 proxy_->blocking_main_thread_task_runner(), 2182 proxy_->blocking_main_thread_task_runner(),
2173 settings_.renderer_settings.highp_threshold_min, 2183 settings_.renderer_settings.highp_threshold_min,
2174 settings_.renderer_settings.use_rgba_4444_textures, 2184 settings_.renderer_settings.use_rgba_4444_textures,
2175 settings_.renderer_settings.texture_id_allocation_chunk_size); 2185 settings_.renderer_settings.texture_id_allocation_chunk_size);
2176 2186
2177 CreateAndSetRenderer(); 2187 CreateAndSetRenderer();
2178 2188
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3409 new_target.SetToMin(layer_impl->MaxScrollOffset());
3400 3410
3401 curve->UpdateTarget( 3411 curve->UpdateTarget(
3402 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3412 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3403 .InSecondsF(), 3413 .InSecondsF(),
3404 new_target); 3414 new_target);
3405 3415
3406 return true; 3416 return true;
3407 } 3417 }
3408 } // namespace cc 3418 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698