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

Side by Side Diff: include/gpu/gl/command_buffer/SkCommandBufferGLContext.h

Issue 1306823003: skia: add ability to load command_buffer_gles2 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: and NULL->nullptr, just because. Created 5 years, 3 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 | « include/gpu/gl/GrGLInterface.h ('k') | include/views/SkOSWindow_Win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2015 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8 #ifndef SKCOMMANDBUFFERGLCONTEXT_DEFINED
9 #define SKCOMMANDBUFFERGLCONTEXT_DEFINED
10
11 #if SK_COMMAND_BUFFER
12
13 #include "gl/SkGLContext.h"
14
15 class SkCommandBufferGLContext : public SkGLContext {
16 public:
17 ~SkCommandBufferGLContext() override;
18
19 static SkCommandBufferGLContext* Create(GrGLStandard forcedGpuAPI) {
20 if (kGL_GrGLStandard == forcedGpuAPI) {
21 return nullptr;
22 }
23 SkCommandBufferGLContext* ctx = new SkCommandBufferGLContext;
24 if (!ctx->isValid()) {
25 delete ctx;
26 return nullptr;
27 }
28 return ctx;
29 }
30
31 static SkCommandBufferGLContext* Create(void* nativeWindow, int msaaSampleCo unt) {
32 SkCommandBufferGLContext* ctx = new SkCommandBufferGLContext(nativeWindo w,
33 msaaSampleC ount);
34 if (!ctx->isValid()) {
35 delete ctx;
36 return nullptr;
37 }
38 return ctx;
39 }
40
41 void presentCommandBuffer();
42
43 bool makeCurrent();
44 int getStencilBits();
45 int getSampleCount();
46
47 private:
48 SkCommandBufferGLContext();
49 SkCommandBufferGLContext(void* nativeWindow, int msaaSampleCount);
50 void initializeGLContext(void* nativeWindow, const int* configAttribs,
51 const int* surfaceAttribs);
52 void destroyGLContext();
53
54 void onPlatformMakeCurrent() const override;
55 void onPlatformSwapBuffers() const override;
56 GrGLFuncPtr onPlatformGetProcAddress(const char* name) const override;
57
58 void* fContext;
59 void* fDisplay;
60 void* fSurface;
61 void* fConfig;
62 };
63
64 #endif // SK_COMMAND_BUFFER
65
66 #endif
OLDNEW
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | include/views/SkOSWindow_Win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698