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

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

Issue 2179363003: Update iOS to new SkSurface interface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | no next file » | 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 fCurRenderTarget = NULL; 116 fCurRenderTarget = NULL;
117 #endif 117 #endif
118 win->release(); 118 win->release();
119 fBackend = SampleWindow::kNone_BackEndType; 119 fBackend = SampleWindow::kNone_BackEndType;
120 } 120 }
121 121
122 SkSurface* createSurface(SampleWindow::DeviceType dType, SampleWindow* win) override{ 122 SkSurface* createSurface(SampleWindow::DeviceType dType, SampleWindow* win) override{
123 #if SK_SUPPORT_GPU 123 #if SK_SUPPORT_GPU
124 if (SampleWindow::IsGpuDeviceType(dType) && fCurContext) { 124 if (SampleWindow::IsGpuDeviceType(dType) && fCurContext) {
125 SkSurfaceProps props(win->getSurfaceProps()); 125 SkSurfaceProps props(win->getSurfaceProps());
126 return SkSurface::NewRenderTargetDirect(fCurRenderTarget, &props); 126 return SkSurface::MakeRenderTargetDirect(fCurRenderTarget,
127 sk_ref_sp(win->info().color Space()),
128 &props).release();
127 } 129 }
128 #endif 130 #endif
129 return NULL; 131 return nullptr;
130 } 132 }
131 133
132 virtual void publishCanvas(SampleWindow::DeviceType dType, 134 virtual void publishCanvas(SampleWindow::DeviceType dType,
133 SkCanvas* canvas, 135 SkCanvas* canvas,
134 SampleWindow* win) override { 136 SampleWindow* win) override {
135 #if SK_SUPPORT_GPU 137 #if SK_SUPPORT_GPU
136 if (NULL != fCurContext) { 138 if (NULL != fCurContext) {
137 fCurContext->flush(); 139 fCurContext->flush();
138 } 140 }
139 #endif 141 #endif
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); 487 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer);
486 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 488 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
487 GL_RENDERBUFFER_STENCIL_SIZE, 489 GL_RENDERBUFFER_STENCIL_SIZE,
488 &info->fStencilBits); 490 &info->fStencilBits);
489 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 491 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
490 GL_RENDERBUFFER_SAMPLES_APPLE, 492 GL_RENDERBUFFER_SAMPLES_APPLE,
491 &info->fSampleCount); 493 &info->fSampleCount);
492 } 494 }
493 495
494 @end 496 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698