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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 1419843002: Hold a reference to any kind of context in WindowAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 #include "content/browser/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 new cc::SurfaceIdAllocator(++g_surface_id_namespace)); 225 new cc::SurfaceIdAllocator(++g_surface_id_namespace));
226 cc::SurfaceManager* manager = GetSurfaceManager(); 226 cc::SurfaceManager* manager = GetSurfaceManager();
227 DCHECK(manager); 227 DCHECK(manager);
228 allocator->RegisterSurfaceIdNamespace(manager); 228 allocator->RegisterSurfaceIdNamespace(manager);
229 return allocator.Pass(); 229 return allocator.Pass();
230 } 230 }
231 231
232 CompositorImpl::CompositorImpl(CompositorClient* client, 232 CompositorImpl::CompositorImpl(CompositorClient* client,
233 gfx::NativeWindow root_window) 233 gfx::NativeWindow root_window)
234 : root_layer_(cc::Layer::Create(Compositor::LayerSettings())), 234 : root_layer_(cc::Layer::Create(Compositor::LayerSettings())),
235 resource_manager_(root_window->GetJavaDisplayContext().obj()),
boliu 2015/10/21 16:55:38 So continuing the previous conversation, can resou
gsennton 2015/10/21 17:09:08 I don't see how that would help (but I might be mi
boliu 2015/10/21 17:13:34 Conceptually, window_android.cc and resource_manag
gsennton 2015/10/22 10:33:36 ../../ui/android/java/src/org/chromium/ui/resource
boliu 2015/10/22 14:12:59 Jared, any thoughts here? A bit weird these Window
235 surface_id_allocator_(GetSurfaceManager() ? CreateSurfaceIdAllocator() 236 surface_id_allocator_(GetSurfaceManager() ? CreateSurfaceIdAllocator()
236 : nullptr), 237 : nullptr),
237 has_transparent_background_(false), 238 has_transparent_background_(false),
238 device_scale_factor_(1), 239 device_scale_factor_(1),
239 window_(NULL), 240 window_(NULL),
240 surface_id_(0), 241 surface_id_(0),
241 client_(client), 242 client_(client),
242 root_window_(root_window), 243 root_window_(root_window),
243 did_post_swapbuffers_(false), 244 did_post_swapbuffers_(false),
244 ignore_schedule_composite_(false), 245 ignore_schedule_composite_(false),
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 800
800 void CompositorImpl::SetNeedsAnimate() { 801 void CompositorImpl::SetNeedsAnimate() {
801 needs_animate_ = true; 802 needs_animate_ = true;
802 if (!host_->visible()) 803 if (!host_->visible())
803 return; 804 return;
804 805
805 host_->SetNeedsAnimate(); 806 host_->SetNeedsAnimate();
806 } 807 }
807 808
808 } // namespace content 809 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698