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

Side by Side Diff: src/gpu/gl/SkGLContext.cpp

Issue 1612513002: Add a background timing thread to kilobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 4 years, 11 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 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gl/SkGLContext.h" 8 #include "gl/SkGLContext.h"
9 #include "GrGLUtil.h" 9 #include "GrGLUtil.h"
10 #include "SkGpuFenceSync.h" 10 #include "SkGpuFenceSync.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 fFenceSync.reset(nullptr); 70 fFenceSync.reset(nullptr);
71 } 71 }
72 72
73 fGL.reset(nullptr); 73 fGL.reset(nullptr);
74 } 74 }
75 75
76 void SkGLContext::makeCurrent() const { 76 void SkGLContext::makeCurrent() const {
77 this->onPlatformMakeCurrent(); 77 this->onPlatformMakeCurrent();
78 } 78 }
79 79
80 void SkGLContext::swapBuffers() { 80 void SkGLContext::swapBuffers(bool usePlatformSwapBuffers) {
81 if (!fFenceSync) { 81 if (!fFenceSync || usePlatformSwapBuffers) {
82 // Fallback on the platform SwapBuffers method for synchronization. This may have no effect. 82 // Fallback on the platform SwapBuffers method for synchronization. This may have no effect.
83 this->onPlatformSwapBuffers(); 83 this->onPlatformSwapBuffers();
84 return; 84 return;
85 } 85 }
86 86
87 if (fFrameFences[fCurrentFenceIdx]) { 87 if (fFrameFences[fCurrentFenceIdx]) {
88 if (!fFenceSync->flushAndWaitFence(fFrameFences[fCurrentFenceIdx])) { 88 if (!fFenceSync->flushAndWaitFence(fFrameFences[fCurrentFenceIdx])) {
89 SkDebugf("WARNING: Wait failed for fence sync. Timings might not be accurate.\n"); 89 SkDebugf("WARNING: Wait failed for fence sync. Timings might not be accurate.\n");
90 } 90 }
91 fFenceSync->deleteFence(fFrameFences[fCurrentFenceIdx]); 91 fFenceSync->deleteFence(fFrameFences[fCurrentFenceIdx]);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_MIN_FIL TER, 173 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_MIN_FIL TER,
174 GR_GL_NEAREST)); 174 GR_GL_NEAREST));
175 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_S, 175 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_S,
176 GR_GL_CLAMP_TO_EDGE)); 176 GR_GL_CLAMP_TO_EDGE));
177 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_T, 177 GR_GL_CALL(fGL, TexParameteri(GR_GL_TEXTURE_RECTANGLE, GR_GL_TEXTURE_WRAP_T,
178 GR_GL_CLAMP_TO_EDGE)); 178 GR_GL_CLAMP_TO_EDGE));
179 GR_GL_CALL(fGL, TexImage2D(GR_GL_TEXTURE_RECTANGLE, 0, internalFormat, width , height, 0, 179 GR_GL_CALL(fGL, TexImage2D(GR_GL_TEXTURE_RECTANGLE, 0, internalFormat, width , height, 0,
180 externalFormat, externalType, data)); 180 externalFormat, externalType, data));
181 return id; 181 return id;
182 } 182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698