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

Side by Side Diff: experimental/iOSSampleApp/SkSampleUIView.mm

Issue 1538343002: SampleApp: remove Picture_DeviceType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « no previous file | samplecode/SampleApp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #import "SkSampleUIView.h" 8 #import "SkSampleUIView.h"
9 9
10 //#define SKGL_CONFIG kEAGLColorFormatRGB565 10 //#define SKGL_CONFIG kEAGLColorFormatRGB565
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #endif 47 #endif
48 } 48 }
49 49
50 void setUpBackend(SampleWindow* win, int msaaSampleCount) override { 50 void setUpBackend(SampleWindow* win, int msaaSampleCount) override {
51 SkASSERT(SkOSWindow::kNone_BackEndType == fBackend); 51 SkASSERT(SkOSWindow::kNone_BackEndType == fBackend);
52 52
53 fBackend = SkOSWindow::kNone_BackEndType; 53 fBackend = SkOSWindow::kNone_BackEndType;
54 54
55 #if SK_SUPPORT_GPU 55 #if SK_SUPPORT_GPU
56 switch (win->getDeviceType()) { 56 switch (win->getDeviceType()) {
57 // these two don't use GL
58 case SampleWindow::kRaster_DeviceType: 57 case SampleWindow::kRaster_DeviceType:
59 case SampleWindow::kPicture_DeviceType:
60 break; 58 break;
61 // these guys use the native backend 59 // these guys use the native backend
62 case SampleWindow::kGPU_DeviceType: 60 case SampleWindow::kGPU_DeviceType:
63 fBackend = SkOSWindow::kNativeGL_BackEndType; 61 fBackend = SkOSWindow::kNativeGL_BackEndType;
64 break; 62 break;
65 default: 63 default:
66 SkASSERT(false); 64 SkASSERT(false);
67 break; 65 break;
68 } 66 }
69 SkOSWindow::AttachmentInfo info; 67 SkOSWindow::AttachmentInfo info;
70 bool result = win->attach(fBackend, msaaSampleCount, &info); 68 bool result = win->attach(fBackend, msaaSampleCount, &info);
71 if (!result) { 69 if (!result) {
72 SkDebugf("Failed to initialize GL"); 70 SkDebugf("Failed to initialize GL");
73 return; 71 return;
74 } 72 }
75 fMSAASampleCount = msaaSampleCount; 73 fMSAASampleCount = msaaSampleCount;
76 74
77 SkASSERT(NULL == fCurIntf); 75 SkASSERT(NULL == fCurIntf);
78 switch (win->getDeviceType()) { 76 switch (win->getDeviceType()) {
79 // these two don't use GL
80 case SampleWindow::kRaster_DeviceType: 77 case SampleWindow::kRaster_DeviceType:
81 case SampleWindow::kPicture_DeviceType:
82 fCurIntf = NULL; 78 fCurIntf = NULL;
83 break; 79 break;
84 case SampleWindow::kGPU_DeviceType: 80 case SampleWindow::kGPU_DeviceType:
85 fCurIntf = GrGLCreateNativeInterface(); 81 fCurIntf = GrGLCreateNativeInterface();
86 break; 82 break;
87 default: 83 default:
88 SkASSERT(false); 84 SkASSERT(false);
89 break; 85 break;
90 } 86 }
91 87
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); 482 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer);
487 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 483 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
488 GL_RENDERBUFFER_STENCIL_SIZE, 484 GL_RENDERBUFFER_STENCIL_SIZE,
489 &info->fStencilBits); 485 &info->fStencilBits);
490 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 486 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
491 GL_RENDERBUFFER_SAMPLES_APPLE, 487 GL_RENDERBUFFER_SAMPLES_APPLE,
492 &info->fSampleCount); 488 &info->fSampleCount);
493 } 489 }
494 490
495 @end 491 @end
OLDNEW
« no previous file with comments | « no previous file | samplecode/SampleApp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698