aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLExternalTextureData.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-03-02 15:09:20 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-02 20:47:36 +0000
commitfe3b51636d4216c4ea6cb74ed0964c1d315ca487 (patch)
treee85907dad1a167ecceace5de1e6157a787fe0bac /src/gpu/gl/GrGLExternalTextureData.cpp
parente836b7817e8b28f0bd69578b8dfd83b8ef00248c (diff)
Use GrSemaphore rather than GrFence for external texture data
BUG=skia: Change-Id: I0d23eb9dcf5c01c71d3571ef97690af68b900807 Reviewed-on: https://skia-review.googlesource.com/9141 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLExternalTextureData.cpp')
-rw-r--r--src/gpu/gl/GrGLExternalTextureData.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLExternalTextureData.cpp b/src/gpu/gl/GrGLExternalTextureData.cpp
new file mode 100644
index 0000000000..32c49b17a8
--- /dev/null
+++ b/src/gpu/gl/GrGLExternalTextureData.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrContext.h"
+#include "GrGpu.h"
+#include "GrSemaphore.h"
+#include "gl/GrGLTypes.h"
+
+GrGLExternalTextureData::GrGLExternalTextureData(const GrGLTextureInfo& info,
+ sk_sp<GrSemaphore> semaphore)
+ : fInfo(info)
+ , fSemaphore(std::move(semaphore)) {
+ SkASSERT(fSemaphore->unique());
+ fSemaphore->resetGpu(nullptr);
+}
+
+void GrGLExternalTextureData::attachToContext(GrContext* context) {
+ fSemaphore->resetGpu(context->getGpu());
+ context->getGpu()->waitSemaphore(fSemaphore);
+}