OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gl_fence_nv.h" | 5 #include "ui/gl/gl_fence_nv.h" |
6 | 6 |
7 #include "ui/gl/gl_bindings.h" | 7 #include "ui/gl/gl_bindings.h" |
8 #include "ui/gl/gl_context.h" | 8 #include "ui/gl/gl_context.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 bool GLFenceNV::HasCompleted() { | 33 bool GLFenceNV::HasCompleted() { |
34 DCHECK(glIsFenceNV(fence_)); | 34 DCHECK(glIsFenceNV(fence_)); |
35 return !!glTestFenceNV(fence_); | 35 return !!glTestFenceNV(fence_); |
36 } | 36 } |
37 | 37 |
38 void GLFenceNV::ClientWait() { | 38 void GLFenceNV::ClientWait() { |
39 DCHECK(glIsFenceNV(fence_)); | 39 DCHECK(glIsFenceNV(fence_)); |
40 if (!flush_event_ || flush_event_->IsSignaled()) { | 40 if (!flush_event_.get() || flush_event_->IsSignaled()) { |
41 glFinishFenceNV(fence_); | 41 glFinishFenceNV(fence_); |
42 } else { | 42 } else { |
43 LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping..."; | 43 LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping..."; |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 void GLFenceNV::ServerWait() { | 47 void GLFenceNV::ServerWait() { |
48 DCHECK(glIsFenceNV(fence_)); | 48 DCHECK(glIsFenceNV(fence_)); |
49 ClientWait(); | 49 ClientWait(); |
50 } | 50 } |
51 | 51 |
52 GLFenceNV::~GLFenceNV() { | 52 GLFenceNV::~GLFenceNV() { |
53 DCHECK(glIsFenceNV(fence_)); | 53 DCHECK(glIsFenceNV(fence_)); |
54 glDeleteFencesNV(1, &fence_); | 54 glDeleteFencesNV(1, &fence_); |
55 } | 55 } |
56 | 56 |
57 } // namespace gfx | 57 } // namespace gfx |
OLD | NEW |