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

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

Issue 312803002: Android media: VideoFrame should not store so many sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address reviewers' comments Created 6 years, 5 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/image_transport_factory_android.h" 5 #include "content/browser/renderer_host/image_transport_factory_android.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
10 #include "content/common/gpu/client/gl_helper.h" 10 #include "content/common/gpu/client/gl_helper.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (!gl_helper_) 97 if (!gl_helper_)
98 gl_helper_.reset(new GLHelper(context_->GetImplementation(), 98 gl_helper_.reset(new GLHelper(context_->GetImplementation(),
99 context_->GetContextSupport())); 99 context_->GetContextSupport()));
100 100
101 return gl_helper_.get(); 101 return gl_helper_.get();
102 } 102 }
103 103
104 } // anonymous namespace 104 } // anonymous namespace
105 105
106 // static 106 // static
107 void ImageTransportFactoryAndroid::InitializeForUnitTests(
108 ImageTransportFactoryAndroid* test_factory) {
109 DCHECK(!g_factory);
110 g_factory = test_factory;
111 }
112
113 // static
114 void ImageTransportFactoryAndroid::TerminateForUnitTests() {
dshwang 2014/07/10 21:44:25 sievers@, Terminate is added to teardown.
115 DCHECK(g_factory);
116 delete g_factory;
117 g_factory = NULL;
118 }
119
120 // static
107 ImageTransportFactoryAndroid* ImageTransportFactoryAndroid::GetInstance() { 121 ImageTransportFactoryAndroid* ImageTransportFactoryAndroid::GetInstance() {
108 if (!g_factory) 122 if (!g_factory)
109 g_factory = new CmdBufferImageTransportFactory(); 123 g_factory = new CmdBufferImageTransportFactory();
110 124
111 return g_factory; 125 return g_factory;
112 } 126 }
113 127
114 ImageTransportFactoryAndroid::ImageTransportFactoryAndroid() 128 ImageTransportFactoryAndroid::ImageTransportFactoryAndroid()
115 : context_lost_listener_(new GLContextLostListener()) {} 129 : context_lost_listener_(new GLContextLostListener()) {}
116 130
(...skipping 20 matching lines...) Expand all
137 151
138 void GLContextLostListener::DidLoseContext() { 152 void GLContextLostListener::DidLoseContext() {
139 delete g_factory; 153 delete g_factory;
140 g_factory = NULL; 154 g_factory = NULL;
141 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, 155 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver,
142 g_factory_observers.Get(), 156 g_factory_observers.Get(),
143 OnLostResources()); 157 OnLostResources());
144 } 158 }
145 159
146 } // namespace content 160 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698