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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 890873003: update example (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove multiple example cruft Created 5 years, 10 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 | « include/views/SkWindow.h ('k') | src/views/SkWindow.cpp » ('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 2011 Google Inc. 2 * Copyright 2011 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 #include "SampleApp.h" 8 #include "SampleApp.h"
9 9
10 #include "OverView.h" 10 #include "OverView.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 #endif 308 #endif
309 309
310 win->present(); 310 win->present();
311 } 311 }
312 312
313 virtual void windowSizeChanged(SampleWindow* win) { 313 virtual void windowSizeChanged(SampleWindow* win) {
314 #if SK_SUPPORT_GPU 314 #if SK_SUPPORT_GPU
315 if (fCurContext) { 315 if (fCurContext) {
316 AttachmentInfo attachmentInfo; 316 AttachmentInfo attachmentInfo;
317 win->attach(fBackend, fMSAASampleCount, &attachmentInfo); 317 win->attach(fBackend, fMSAASampleCount, &attachmentInfo);
318
319 GrBackendRenderTargetDesc desc;
320 desc.fWidth = SkScalarRoundToInt(win->width());
321 desc.fHeight = SkScalarRoundToInt(win->height());
322 desc.fConfig = kSkia8888_GrPixelConfig;
323 desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
324 desc.fSampleCnt = attachmentInfo.fSampleCount;
325 desc.fStencilBits = attachmentInfo.fStencilBits;
326 GrGLint buffer;
327 GR_GL_GetIntegerv(fCurIntf, GR_GL_FRAMEBUFFER_BINDING, &buffer);
328 desc.fRenderTargetHandle = buffer;
329
330 SkSafeUnref(fCurRenderTarget); 318 SkSafeUnref(fCurRenderTarget);
331 fCurRenderTarget = fCurContext->wrapBackendRenderTarget(desc); 319 fCurRenderTarget = win->renderTarget(attachmentInfo, fCurIntf, fCurC ontext);
332 } 320 }
333 #endif 321 #endif
334 } 322 }
335 323
336 virtual GrContext* getGrContext() { 324 virtual GrContext* getGrContext() {
337 #if SK_SUPPORT_GPU 325 #if SK_SUPPORT_GPU
338 return fCurContext; 326 return fCurContext;
339 #else 327 #else
340 return NULL; 328 return NULL;
341 #endif 329 #endif
(...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after
2432 setenv("ANDROID_ROOT", "/android/device/data", 0); 2420 setenv("ANDROID_ROOT", "/android/device/data", 0);
2433 #endif 2421 #endif
2434 SkGraphics::Init(); 2422 SkGraphics::Init();
2435 SkEvent::Init(); 2423 SkEvent::Init();
2436 } 2424 }
2437 2425
2438 void application_term() { 2426 void application_term() {
2439 SkEvent::Term(); 2427 SkEvent::Term();
2440 SkGraphics::Term(); 2428 SkGraphics::Term();
2441 } 2429 }
OLDNEW
« no previous file with comments | « include/views/SkWindow.h ('k') | src/views/SkWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698