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

Side by Side Diff: experimental/fiddle/OSMesaContextHolder.cpp

Issue 1349163003: experiment/fiddle (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include <stdio.h>
9 #include <stdint.h>
10
11 #include <GL/osmesa.h>
12
13 #include "OSMesaContextHolder.h"
14
15 OSMesaContextHolder::OSMesaContextHolder() {
16 fOSMesaContext = OSMesaCreateContextExt(0x1, 0, 0, 0, nullptr);
17 if (!fOSMesaContext) {
18 fputs("Unable to get OSMesa context.\n", stderr);
19 } else {
20 static uint32_t buffer[16 * 16];
21 OSMesaMakeCurrent(fOSMesaContext, &buffer, 0x1401, 16, 16);
22 }
23 }
24
25 OSMesaContextHolder::~OSMesaContextHolder() {
26 if (fOSMesaContext) {
27 OSMesaDestroyContext(fOSMesaContext);
28 }
29 }
30
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698