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

Side by Side Diff: content/common/gpu/stream_texture_android.cc

Issue 1652873002: Android: Use virtualized context only for those with compatible config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment addressed Created 4 years, 10 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/common/gpu/stream_texture_android.h" 5 #include "content/common/gpu/stream_texture_android.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/stringize_macros.h" 10 #include "base/strings/stringize_macros.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 void StreamTexture::Destroy(bool have_context) { 120 void StreamTexture::Destroy(bool have_context) {
121 NOTREACHED(); 121 NOTREACHED();
122 } 122 }
123 123
124 scoped_ptr<ui::ScopedMakeCurrent> StreamTexture::MakeStubCurrent() { 124 scoped_ptr<ui::ScopedMakeCurrent> StreamTexture::MakeStubCurrent() {
125 scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current; 125 scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current;
126 bool needs_make_current = 126 bool needs_make_current =
127 !owner_stub_->decoder()->GetGLContext()->IsCurrent(NULL); 127 !owner_stub_->decoder()->GetGLContext()->IsCurrent(NULL);
128 // On Android we should not have to perform a real context switch here when
129 // using virtual contexts.
130 DCHECK(!needs_make_current ||
131 !owner_stub_->decoder()
132 ->GetContextGroup()
133 ->feature_info()
134 ->workarounds()
135 .use_virtualized_gl_contexts);
136 if (needs_make_current) { 128 if (needs_make_current) {
137 scoped_make_current.reset(new ui::ScopedMakeCurrent( 129 scoped_make_current.reset(new ui::ScopedMakeCurrent(
138 owner_stub_->decoder()->GetGLContext(), owner_stub_->surface())); 130 owner_stub_->decoder()->GetGLContext(), owner_stub_->surface()));
139 } 131 }
140 return scoped_make_current; 132 return scoped_make_current;
141 } 133 }
142 134
143 void StreamTexture::UpdateTexImage() { 135 void StreamTexture::UpdateTexImage() {
144 DCHECK(surface_texture_.get()); 136 DCHECK(surface_texture_.get());
145 DCHECK(owner_stub_); 137 DCHECK(owner_stub_);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 return false; 369 return false;
378 } 370 }
379 371
380 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, 372 void StreamTexture::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
381 uint64_t process_tracing_id, 373 uint64_t process_tracing_id,
382 const std::string& dump_name) { 374 const std::string& dump_name) {
383 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 375 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914
384 } 376 }
385 377
386 } // namespace content 378 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698