OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
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 */ | 8 */ |
9 | 9 |
10 #include "SkExample.h" | 10 #include "SkExample.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 fContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInterface
); | 86 fContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext)fInterface
); |
87 SkASSERT(NULL != fContext); | 87 SkASSERT(NULL != fContext); |
88 | 88 |
89 setupRenderTarget(); | 89 setupRenderTarget(); |
90 | 90 |
91 return true; | 91 return true; |
92 } | 92 } |
93 | 93 |
94 void SkExampleWindow::setupRenderTarget() { | 94 void SkExampleWindow::setupRenderTarget() { |
95 GrBackendRenderTargetDesc desc; | 95 GrBackendRenderTargetDesc desc; |
96 desc.fWidth = SkScalarRound(width()); | 96 desc.fWidth = SkScalarRoundToInt(width()); |
97 desc.fHeight = SkScalarRound(height()); | 97 desc.fHeight = SkScalarRoundToInt(height()); |
98 desc.fConfig = kSkia8888_GrPixelConfig; | 98 desc.fConfig = kSkia8888_GrPixelConfig; |
99 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 99 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
100 desc.fSampleCnt = fAttachmentInfo.fSampleCount; | 100 desc.fSampleCnt = fAttachmentInfo.fSampleCount; |
101 desc.fStencilBits = fAttachmentInfo.fStencilBits; | 101 desc.fStencilBits = fAttachmentInfo.fStencilBits; |
102 | 102 |
103 GrGLint buffer; | 103 GrGLint buffer; |
104 GR_GL_GetIntegerv(fInterface, GR_GL_FRAMEBUFFER_BINDING, &buffer); | 104 GR_GL_GetIntegerv(fInterface, GR_GL_FRAMEBUFFER_BINDING, &buffer); |
105 desc.fRenderTargetHandle = buffer; | 105 desc.fRenderTargetHandle = buffer; |
106 | 106 |
107 fRenderTarget = fContext->wrapBackendRenderTarget(desc); | 107 fRenderTarget = fContext->wrapBackendRenderTarget(desc); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 SkDebugf("No SkExample that matches your query\n"); | 185 SkDebugf("No SkExample that matches your query\n"); |
186 } | 186 } |
187 } | 187 } |
188 return true; | 188 return true; |
189 } | 189 } |
190 | 190 |
191 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 191 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
192 SkCommandLineFlags::Parse(argc, argv); | 192 SkCommandLineFlags::Parse(argc, argv); |
193 return new SkExampleWindow(hwnd); | 193 return new SkExampleWindow(hwnd); |
194 } | 194 } |
OLD | NEW |