aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-03 18:04:51 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-03 18:04:51 +0000
commit3c4d032aeb2831a64fd6eff570667d590e3ed209 (patch)
tree65bc1d75e4ee070b516870b0be319cfa63aee9c2
parent5f017a4ab001baf1b9f433a9b02c6e01f93a97a1 (diff)
Revert 3857 (which was committed from wrong tree)
git-svn-id: http://skia.googlecode.com/svn/trunk@3588 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/views/SkOSWindow_Mac.h7
-rw-r--r--include/views/SkOSWindow_Unix.h2
-rw-r--r--include/views/SkOSWindow_Win.h6
-rw-r--r--samplecode/SampleApp.cpp23
-rw-r--r--samplecode/SampleApp.h4
-rw-r--r--src/gpu/GrContext.cpp11
-rw-r--r--src/gpu/gl/GrGpuGL.cpp12
-rw-r--r--src/views/mac/SkNSView.h2
-rw-r--r--src/views/mac/SkNSView.mm44
-rw-r--r--src/views/mac/SkOSWindow_Mac.mm4
-rw-r--r--src/views/unix/SkOSWindow_Unix.cpp2
-rw-r--r--src/views/win/SkOSWindow_win.cpp110
12 files changed, 90 insertions, 137 deletions
diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h
index e3bcea9081..01fa29f334 100644
--- a/include/views/SkOSWindow_Mac.h
+++ b/include/views/SkOSWindow_Mac.h
@@ -16,18 +16,19 @@ public:
SkOSWindow(void* hwnd);
~SkOSWindow();
void* getHWND() const { return fHWND; }
-
+
virtual bool onDispatchClick(int x, int y, Click::State state,
void* owner);
+
enum SkBackEndTypes {
kNone_BackEndType,
kNativeGL_BackEndType,
};
void detach();
- bool attach(SkBackEndTypes attachType, int msaaSampleCount);
+ bool attach(SkBackEndTypes attachType);
void present();
-
+
protected:
// overrides from SkEventSink
virtual bool onEvent(const SkEvent& evt);
diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h
index e9755ab2b4..40059bf8d4 100644
--- a/include/views/SkOSWindow_Unix.h
+++ b/include/views/SkOSWindow_Unix.h
@@ -40,7 +40,7 @@ public:
kNativeGL_BackEndType,
};
- bool attach(SkBackEndTypes attachType, int msaaSampleCount);
+ bool attach(SkBackEndTypes attachType);
void detach();
void present();
diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h
index 4223645614..2663c8c75d 100644
--- a/include/views/SkOSWindow_Win.h
+++ b/include/views/SkOSWindow_Win.h
@@ -36,7 +36,7 @@ public:
kD3D9_BackEndType
};
- bool attach(SkBackEndTypes attachType, int msaaSampleCount);
+ bool attach(SkBackEndTypes attachType);
void detach();
void present();
@@ -78,13 +78,13 @@ private:
SkBackEndTypes fAttached;
- bool attachGL(int msaaSampleCount);
+ bool attachGL();
void detachGL();
void presentGL();
#if SK_ANGLE
bool attachANGLE();
- void detachANGLE(int msaaSampleCount);
+ void detachANGLE();
void presentANGLE();
#endif
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index ad0bdaaec2..92c9e6c984 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -139,8 +139,7 @@ public:
: fCurContext(NULL)
, fCurIntf(NULL)
, fCurRenderTarget(NULL)
- , fBackend(kNone_BackEndType)
- , fMSAASampleCount(0) {
+ , fBackend(kNone_BackEndType) {
}
virtual ~DefaultDeviceManager() {
@@ -149,7 +148,7 @@ public:
SkSafeUnref(fCurRenderTarget);
}
- virtual void setUpBackend(SampleWindow* win, int msaaSampleCount) {
+ virtual void setUpBackend(SampleWindow* win) {
SkASSERT(kNone_BackEndType == fBackend);
fBackend = kNone_BackEndType;
@@ -176,12 +175,11 @@ public:
break;
}
- bool result = win->attach(fBackend, msaaSampleCount);
+ bool result = win->attach(fBackend);
if (!result) {
SkDebugf("Failed to initialize GL");
return;
}
- fMSAASampleCount = msaaSampleCount;
SkASSERT(NULL == fCurIntf);
switch (win->getDeviceType()) {
@@ -289,7 +287,7 @@ public:
virtual void windowSizeChanged(SampleWindow* win) {
if (fCurContext) {
- win->attach(fBackend, fMSAASampleCount);
+ win->attach(fBackend);
GrPlatformRenderTargetDesc desc;
desc.fWidth = SkScalarRound(win->width());
@@ -315,7 +313,6 @@ private:
GrRenderTarget* fCurRenderTarget;
SkOSWindow::SkBackEndTypes fBackend;
- int fMSAASampleCount;
typedef SampleWindow::DeviceManager INHERITED;
};
@@ -648,10 +645,9 @@ static inline SampleWindow::DeviceType cycle_devicetype(SampleWindow::DeviceType
}
static void usage(const char * argv0) {
- SkDebugf("%s [--slide sampleName] [-i resourcePath] [-msaa=<samplecnt>]\n", argv0);
+ SkDebugf("%s [--slide sampleName] [-i resourcePath]\n", argv0);
SkDebugf(" sampleName: sample at which to start.\n");
SkDebugf(" resourcePath: directory that stores image resources.\n");
- SkDebugf(" msaa: request multisampling with the given sample count.\n");
}
SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* devManager) : INHERITED(hwnd) {
@@ -667,7 +663,6 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
const char* resourcePath = NULL;
fCurrIndex = -1;
- fMSAASampleCount = 0;
const char* const commandName = argv[0];
char* const* stop = argv + argc;
@@ -685,9 +680,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
fprintf(stderr, "Unknown sample \"%s\"\n", *argv);
}
}
- } else if (1 == sscanf(*argv, "--msaa=%d", &fMSAASampleCount) &&
- fMSAASampleCount >= 0) {
- }
+ }
else {
usage(commandName);
}
@@ -827,7 +820,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
devManager->ref();
fDevManager = devManager;
}
- fDevManager->setUpBackend(this, fMSAASampleCount);
+ fDevManager->setUpBackend(this);
// If another constructor set our dimensions, ensure that our
// onSizeChange gets called.
@@ -1678,7 +1671,7 @@ void SampleWindow::setDeviceType(DeviceType type) {
fDeviceType = type;
- fDevManager->setUpBackend(this, fMSAASampleCount);
+ fDevManager->setUpBackend(this);
this->updateTitle();
this->inval(NULL);
diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h
index a177b7308c..ba404da515 100644
--- a/samplecode/SampleApp.h
+++ b/samplecode/SampleApp.h
@@ -50,7 +50,7 @@ public:
*/
class DeviceManager : public SkRefCnt {
public:
- virtual void setUpBackend(SampleWindow* win, int msaaSampleCount) = 0;
+ virtual void setUpBackend(SampleWindow* win) = 0;
virtual void tearDownBackend(SampleWindow* win) = 0;
@@ -170,8 +170,6 @@ private:
SkOSMenu::TriState fHintingState;
unsigned fFlipAxis;
- int fMSAASampleCount;
-
int fScrollTestX, fScrollTestY;
SkScalar fZoomCenterX, fZoomCenterY;
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 7589da9050..4b3d942d61 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -22,11 +22,11 @@
#include "SkTLazy.h"
#include "SkTrace.h"
-#define DEFER_TEXT_RENDERING 0
+#define DEFER_TEXT_RENDERING 1
-#define DEFER_PATHS 0
+#define DEFER_PATHS 1
-#define BATCH_RECT_TO_RECT (0 && !GR_STATIC_RECT_VB)
+#define BATCH_RECT_TO_RECT (1 && !GR_STATIC_RECT_VB)
#define MAX_BLUR_SIGMA 4.0f
@@ -2056,6 +2056,7 @@ void GrContext::setupDrawBuffer() {
GrAssert(NULL == fDrawBufferVBAllocPool);
GrAssert(NULL == fDrawBufferIBAllocPool);
+#if DEFER_TEXT_RENDERING || BATCH_RECT_TO_RECT
fDrawBufferVBAllocPool =
new GrVertexBufferAllocPool(fGpu, false,
DRAW_BUFFER_VBPOOL_BUFFER_SIZE,
@@ -2068,7 +2069,11 @@ void GrContext::setupDrawBuffer() {
fDrawBuffer = new GrInOrderDrawBuffer(fGpu,
fDrawBufferVBAllocPool,
fDrawBufferIBAllocPool);
+#endif
+
+#if BATCH_RECT_TO_RECT
fDrawBuffer->setQuadIndexBuffer(this->getQuadIndexBuffer());
+#endif
fDrawBuffer->setAutoFlushTarget(fGpu);
fDrawBuffer->setDrawState(fDrawState);
}
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 08ab47ab8c..8214b6ea53 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -1848,7 +1848,6 @@ void GrGpuGL::flushAAState(GrPrimitiveType type) {
// we prefer smooth lines over multisampled lines
// msaa should be disabled if drawing smooth lines.
- bool handledMSAA = false;
if (GrIsPrimTypeLines(type)) {
bool smooth = this->willUseHWAALines();
if (!fHWAAState.fSmoothLineEnabled && smooth) {
@@ -1858,15 +1857,14 @@ void GrGpuGL::flushAAState(GrPrimitiveType type) {
GL_CALL(Disable(GR_GL_LINE_SMOOTH));
fHWAAState.fSmoothLineEnabled = false;
}
- if (smooth && rt->isMultisampled() && fHWAAState.fMSAAEnabled) {
+ if (rt->isMultisampled() &&
+ fHWAAState.fMSAAEnabled) {
GL_CALL(Disable(GR_GL_MULTISAMPLE));
fHWAAState.fMSAAEnabled = false;
- handledMSAA = true;
}
- }
- if (!handledMSAA && rt->isMultisampled() &&
- this->getDrawState().isHWAntialiasState() !=
- fHWAAState.fMSAAEnabled) {
+ } else if (rt->isMultisampled() &&
+ this->getDrawState().isHWAntialiasState() !=
+ fHWAAState.fMSAAEnabled) {
if (fHWAAState.fMSAAEnabled) {
GL_CALL(Disable(GR_GL_MULTISAMPLE));
fHWAAState.fMSAAEnabled = false;
diff --git a/src/views/mac/SkNSView.h b/src/views/mac/SkNSView.h
index bf6e67c71c..60727eb3e6 100644
--- a/src/views/mac/SkNSView.h
+++ b/src/views/mac/SkNSView.h
@@ -42,7 +42,7 @@ class SkEvent;
- (void)postInvalWithRect:(const SkIRect*)rectOrNil;
- (BOOL)onHandleEvent:(const SkEvent&)event;
-- (bool)attach:(SkOSWindow::SkBackEndTypes)attachType withMSAASampleCount:(int) sampleCount;
+- (bool)attach:(SkOSWindow::SkBackEndTypes)attachType;
- (void)detach;
- (void)present;
@end
diff --git a/src/views/mac/SkNSView.mm b/src/views/mac/SkNSView.mm
index 9d52814afa..a6aa59cbef 100644
--- a/src/views/mac/SkNSView.mm
+++ b/src/views/mac/SkNSView.mm
@@ -225,36 +225,25 @@ static SkKey raw2key(UInt32 raw)
///////////////////////////////////////////////////////////////////////////////
#include <OpenGL/OpenGL.h>
-namespace {
-CGLContextObj createGLContext(int msaaSampleCount) {
+CGLContextObj createGLContext() {
GLint major, minor;
CGLGetVersion(&major, &minor);
- static const CGLPixelFormatAttribute attributes[] = {
+ const CGLPixelFormatAttribute attributes[] = {
kCGLPFAStencilSize, (CGLPixelFormatAttribute)8,
+#if USE_MSAA
+ kCGLPFASampleBuffers, 1,
+ kCGLPFAMultisample,
+ kCGLPFASamples, 8,
+#endif
kCGLPFAAccelerated,
kCGLPFADoubleBuffer,
(CGLPixelFormatAttribute)0
};
CGLPixelFormatObj format;
- GLint npix = 0;
- if (msaaSampleCount > 0) {
- static int kAttributeCount = SK_ARRAY_COUNT(attributes);
- CGLPixelFormatAttribute msaaAttributes[kAttributeCount + 5];
- memcpy(msaaAttributes, attributes, sizeof(attributes));
- SkASSERT(0 == msaaAttributes[kAttributeCount - 1]);
- msaaAttributes[kAttributeCount - 1] = kCGLPFASampleBuffers;
- msaaAttributes[kAttributeCount + 0] = (CGLPixelFormatAttribute)1;
- msaaAttributes[kAttributeCount + 1] = kCGLPFAMultisample;
- msaaAttributes[kAttributeCount + 2] = kCGLPFASamples;
- msaaAttributes[kAttributeCount + 3] = (CGLPixelFormatAttribute)msaaSampleCount;
- msaaAttributes[kAttributeCount + 4] = (CGLPixelFormatAttribute)0;
- CGLChoosePixelFormat(msaaAttributes, &format, &npix);
- }
- if (!npix) {
- CGLChoosePixelFormat(attributes, &format, &npix);
- }
+ GLint npix;
+ CGLChoosePixelFormat(attributes, &format, &npix);
CGLContextObj ctx;
CGLCreateContext(format, NULL, &ctx);
@@ -265,7 +254,6 @@ CGLContextObj createGLContext(int msaaSampleCount) {
CGLSetCurrentContext(ctx);
return ctx;
}
-}
- (void)viewDidMoveToWindow {
[super viewDidMoveToWindow];
@@ -277,15 +265,12 @@ CGLContextObj createGLContext(int msaaSampleCount) {
[fGLContext setView:self];
}
}
-- (bool)attach:(SkOSWindow::SkBackEndTypes)attachType withMSAASampleCount:(int) sampleCount {
+- (bool)attach:(SkOSWindow::SkBackEndTypes)attachType {
if (nil == fGLContext) {
- CGLContextObj ctx = createGLContext(sampleCount);
- fGLContext = [[NSOpenGLContext alloc] initWithCGLContextObj:ctx];
- CGLReleaseContext(ctx);
+ fGLContext = [[NSOpenGLContext alloc] initWithCGLContextObj:createGLContext()];
if (NULL == fGLContext) {
return false;
}
- [fGLContext setView:self];
}
[fGLContext makeCurrentContext];
@@ -298,13 +283,10 @@ CGLContextObj createGLContext(int msaaSampleCount) {
}
- (void)detach {
- [fGLContext release];
- fGLContext = nil;
+ [fGLContext clearDrawable];
}
- (void)present {
- if (nil != fGLContext) {
- [fGLContext flushBuffer];
- }
+ [fGLContext flushBuffer];
}
@end
diff --git a/src/views/mac/SkOSWindow_Mac.mm b/src/views/mac/SkOSWindow_Mac.mm
index a5d3fef706..4aa4eb5ff8 100644
--- a/src/views/mac/SkOSWindow_Mac.mm
+++ b/src/views/mac/SkOSWindow_Mac.mm
@@ -63,8 +63,8 @@ void SkOSWindow::onUpdateMenu(const SkOSMenu* menu) {
[(SkNSView*)fHWND onUpdateMenu:menu];
}
-bool SkOSWindow::attach(SkBackEndTypes attachType, int sampleCount) {
- return [(SkNSView*)fHWND attach:attachType withMSAASampleCount:sampleCount];
+bool SkOSWindow::attach(SkBackEndTypes attachType) {
+ return [(SkNSView*)fHWND attach:attachType];
}
void SkOSWindow::detach() {
diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp
index 674ea624c1..01bc21c89e 100644
--- a/src/views/unix/SkOSWindow_Unix.cpp
+++ b/src/views/unix/SkOSWindow_Unix.cpp
@@ -170,7 +170,7 @@ void SkOSWindow::mapWindowAndWait()
}
-bool SkOSWindow::attach(SkBackEndTypes /* attachType */, int msaaSampleCount)
+bool SkOSWindow::attach(SkBackEndTypes /* attachType */)
{
if (fGLAttached) return true;
Display* dsp = fUnixWindow.fDisplay;
diff --git a/src/views/win/SkOSWindow_win.cpp b/src/views/win/SkOSWindow_win.cpp
index ecd4c0cd03..c6d345c062 100644
--- a/src/views/win/SkOSWindow_win.cpp
+++ b/src/views/win/SkOSWindow_win.cpp
@@ -313,7 +313,7 @@ void SkEvent::SignalQueueTimer(SkMSec delay)
#define USE_MSAA 0
-HGLRC create_gl(HWND hwnd, int msaaSampleCount) {
+HGLRC create_gl(HWND hwnd) {
HDC dc = GetDC(hwnd);
@@ -328,7 +328,7 @@ HGLRC create_gl(HWND hwnd, int msaaSampleCount) {
int format = 0;
- static const GLint iAttrs[] = {
+ GLint iattrs[] = {
SK_WGL_DRAW_TO_WINDOW, TRUE,
SK_WGL_DOUBLE_BUFFER, TRUE,
SK_WGL_ACCELERATION, SK_WGL_FULL_ACCELERATION,
@@ -336,40 +336,40 @@ HGLRC create_gl(HWND hwnd, int msaaSampleCount) {
SK_WGL_COLOR_BITS, 24,
SK_WGL_ALPHA_BITS, 8,
SK_WGL_STENCIL_BITS, 8,
- 0, 0
+
+ // these must be kept last
+ SK_WGL_SAMPLE_BUFFERS, TRUE,
+ SK_WGL_SAMPLES, 0,
+ 0,0
};
- GLfloat fAttrs[] = {0, 0};
-
- if (msaaSampleCount > 0 &&
- extensions.hasExtension(dc, "WGL_ARB_multisample")) {
- static const int kIAttrsCount = SK_ARRAY_COUNT(iAttrs);
- GLint msaaIAttrs[kIAttrsCount + 4];
- memcpy(msaaIAttrs, iAttrs, sizeof(GLint) * kIAttrsCount);
- SkASSERT(0 == msaaIAttrs[kIAttrsCount - 2] &&
- 0 == msaaIAttrs[kIAttrsCount - 1]);
- msaaIAttrs[kIAttrsCount - 2] = SK_WGL_SAMPLE_BUFFERS;
- msaaIAttrs[kIAttrsCount - 1] = TRUE;
- msaaIAttrs[kIAttrsCount + 0] = SK_WGL_SAMPLES;
- msaaIAttrs[kIAttrsCount + 1] = msaaSampleCount;
- msaaIAttrs[kIAttrsCount + 2] = 0;
- msaaIAttrs[kIAttrsCount + 3] = 0;
- GLuint num;
- int formats[64];
- extensions.choosePixelFormat(dc, msaaIAttrs, fAttrs, 64, formats, &num);
- num = min(num,64);
- for (GLuint i = 0; i < num; ++i) {
- DescribePixelFormat(dc, formats[i], sizeof(pfd), &pfd);
- if (SetPixelFormat(dc, formats[i], &pfd)) {
- format = formats[i];
- break;
+ static const int kSampleBuffersValueIdx = SK_ARRAY_COUNT(iattrs) - 5;
+ static const int kSamplesValueIdx = SK_ARRAY_COUNT(iattrs) - 3;
+ if (USE_MSAA && extensions.hasExtension(dc, "WGL_ARB_multisample")) {
+ for (int samples = 16; samples > 1; --samples) {
+
+ iattrs[kSamplesValueIdx] = samples;
+ GLfloat fattrs[] = {0,0};
+ GLuint num;
+ int formats[64];
+ extensions.choosePixelFormat(dc, iattrs, fattrs, 64, formats, &num);
+ num = min(num,64);
+ for (GLuint i = 0; i < num; ++i) {
+ DescribePixelFormat(dc, formats[i], sizeof(pfd), &pfd);
+ if (SetPixelFormat(dc, formats[i], &pfd)) {
+ format = formats[i];
+ break;
+ }
}
}
}
if (0 == format) {
+ iattrs[kSampleBuffersValueIdx-1] = iattrs[kSampleBuffersValueIdx] = 0;
+ iattrs[kSamplesValueIdx-1] = iattrs[kSamplesValueIdx] = 0;
+ GLfloat fattrs[] = {0,0};
GLuint num;
- extensions.choosePixelFormat(dc, iAttrs, fAttrs, 1, &format, &num);
+ extensions.choosePixelFormat(dc, iattrs, fattrs, 1, &format, &num);
DescribePixelFormat(dc, format, sizeof(pfd), &pfd);
BOOL set = SetPixelFormat(dc, format, &pfd);
SkASSERT(TRUE == set);
@@ -382,9 +382,9 @@ HGLRC create_gl(HWND hwnd, int msaaSampleCount) {
return glrc;
}
-bool SkOSWindow::attachGL(int msaaSampleCount) {
+bool SkOSWindow::attachGL() {
if (NULL == fHGLRC) {
- fHGLRC = create_gl((HWND)fHWND, msaaSampleCount);
+ fHGLRC = create_gl((HWND)fHWND);
if (NULL == fHGLRC) {
return false;
}
@@ -413,15 +413,13 @@ void SkOSWindow::presentGL() {
}
#if SK_ANGLE
-bool create_ANGLE(EGLNativeWindowType hWnd,
- int msaaSampleCount,
- angle::EGLDisplay* eglDisplay,
- angle::EGLContext* eglContext,
- angle::EGLSurface* eglSurface) {
- static EGLint contextAttribs[] = {
+bool create_ANGLE(EGLNativeWindowType hWnd, EGLDisplay* eglDisplay,
+ EGLContext* eglContext, EGLSurface* eglSurface) {
+ EGLint contextAttribs[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE, EGL_NONE
};
- static EGLint configAttribList[] = {
+ EGLint configAttribList[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
@@ -430,7 +428,7 @@ bool create_ANGLE(EGLNativeWindowType hWnd,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};
- static EGLint surfaceAttribList[] = {
+ EGLint surfaceAttribList[] = {
EGL_NONE, EGL_NONE
};
@@ -452,31 +450,9 @@ bool create_ANGLE(EGLNativeWindowType hWnd,
// Choose config
EGLConfig config;
- bool foundConfig = false;
- if (msaaSampleCount) {
- static int kConfigAttribListCnt = SK_ARRAY_COUNT(configAttribList);
- EGLint msaaConfigAttribList[kConfigAttribListCnt + 4];
- memcpy(msaaConfigAttribList,
- configAttribList,
- sizeof(configAttribList));
- SkASSERT(EGL_NONE == msaaConfigAttribList[kConfigAttribListCnt - 1]);
- msaaConfigAttribList[kConfigAttribListCnt - 1] = EGL_SAMPLE_BUFFERS;
- msaaConfigAttribList[kConfigAttribListCnt + 0] = 1;
- msaaConfigAttribList[kConfigAttribListCnt + 1] = EGL_SAMPLES;
- msaaConfigAttribList[kConfigAttribListCnt + 2] = msaaCount;
- msaaConfigAttribList[kConfigAttribListCnt + 3] = EGL_NONE;
- if (eglChooseConfig(display, configAttribList,
- &config, 1, &numConfigs)) {
- if (numConfigs > 0) {
- foundConfig = true;
- }
- }
- }
- if (!foundConfig) {
- if (!eglChooseConfig(display, configAttribList,
- &config, 1, &numConfigs)) {
- return false;
- }
+ if (!eglChooseConfig(display, configAttribList,
+ &config, 1, &numConfigs)) {
+ return false;
}
// Create a surface
@@ -506,7 +482,7 @@ bool create_ANGLE(EGLNativeWindowType hWnd,
return true;
}
-bool SkOSWindow::attachANGLE(int msaaSampleCount) {
+bool SkOSWindow::attachANGLE() {
if (EGL_NO_DISPLAY == fDisplay) {
bool bResult = create_ANGLE((HWND)fHWND, &fDisplay, &fContext, &fSurface);
if (false == bResult) {
@@ -664,7 +640,7 @@ void SkOSWindow::presentD3D9() {
}
// return true on success
-bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount) {
+bool SkOSWindow::attach(SkBackEndTypes attachType) {
// attach doubles as "windowResize" so we need to allo
// already bound states to pass through again
@@ -677,11 +653,11 @@ bool SkOSWindow::attach(SkBackEndTypes attachType, int msaaSampleCount) {
// nothing to do
break;
case kNativeGL_BackEndType:
- result = attachGL(msaaSampleCount);
+ result = attachGL();
break;
#if SK_ANGLE
case kANGLE_BackEndType:
- result = attachANGLE(msaaSampleCount);
+ result = attachANGLE();
break;
#endif
case kD3D9_BackEndType: