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

Side by Side Diff: ui/gl/scoped_make_current.cc

Issue 2926763002: Split DirectCompositionSurfaceWin into two parts. (Closed)
Patch Set: add disallow copy and assign Created 3 years, 6 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
« no previous file with comments | « ui/gl/scoped_make_current.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/gl/scoped_make_current.h" 5 #include "ui/gl/scoped_make_current.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gl/gl_context.h" 8 #include "ui/gl/gl_context.h"
9 #include "ui/gl/gl_surface.h" 9 #include "ui/gl/gl_surface.h"
10 10
(...skipping 17 matching lines...) Expand all
28 previous_context_->MakeCurrent(previous_surface_.get()); 28 previous_context_->MakeCurrent(previous_surface_.get());
29 } else { 29 } else {
30 context_->ReleaseCurrent(surface_.get()); 30 context_->ReleaseCurrent(surface_.get());
31 } 31 }
32 } 32 }
33 33
34 bool ScopedMakeCurrent::Succeeded() const { 34 bool ScopedMakeCurrent::Succeeded() const {
35 return succeeded_; 35 return succeeded_;
36 } 36 }
37 37
38 ScopedReleaseCurrent::ScopedReleaseCurrent(gl::GLSurface* this_surface) {
39 gl::GLContext* current_context = gl::GLContext::GetCurrent();
40 bool was_current =
41 current_context && current_context->IsCurrent(this_surface);
42 if (was_current) {
43 make_current_.emplace(current_context, this_surface);
44 current_context->ReleaseCurrent(this_surface);
45 }
46 }
47
48 ScopedReleaseCurrent::~ScopedReleaseCurrent() {}
49
38 } // namespace ui 50 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gl/scoped_make_current.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698