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

Side by Side Diff: tools/PictureRenderer.cpp

Issue 639793002: Revert of Make the Sk GL context class an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « tools/PictureRenderer.h ('k') | tools/timer/GpuTimer.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 2012 Google Inc. 2 * Copyright 2012 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 "PictureRenderer.h" 8 #include "PictureRenderer.h"
9 #include "picture_utils.h" 9 #include "picture_utils.h"
10 #include "SamplePipeControllers.h" 10 #include "SamplePipeControllers.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 fPicture->cullRect().height() , 221 fPicture->cullRect().height() ,
222 factory.get(), 222 factory.get(),
223 this->recordFlags()); 223 this->recordFlags());
224 fPicture->playback(canvas); 224 fPicture->playback(canvas);
225 fPicture.reset(recorder.endRecording()); 225 fPicture.reset(recorder.endRecording());
226 } 226 }
227 } 227 }
228 228
229 void PictureRenderer::resetState(bool callFinish) { 229 void PictureRenderer::resetState(bool callFinish) {
230 #if SK_SUPPORT_GPU 230 #if SK_SUPPORT_GPU
231 SkGLContext* glContext = this->getGLContext(); 231 SkGLContextHelper* glContext = this->getGLContext();
232 if (NULL == glContext) { 232 if (NULL == glContext) {
233 SkASSERT(kBitmap_DeviceType == fDeviceType); 233 SkASSERT(kBitmap_DeviceType == fDeviceType);
234 return; 234 return;
235 } 235 }
236 236
237 fGrContext->flush(); 237 fGrContext->flush();
238 glContext->swapBuffers(); 238 glContext->swapBuffers();
239 if (callFinish) { 239 if (callFinish) {
240 SK_GL(*glContext, Finish()); 240 SK_GL(*glContext, Finish());
241 } 241 }
242 #endif 242 #endif
243 } 243 }
244 244
245 void PictureRenderer::purgeTextures() { 245 void PictureRenderer::purgeTextures() {
246 SkDiscardableMemoryPool* pool = SkGetGlobalDiscardableMemoryPool(); 246 SkDiscardableMemoryPool* pool = SkGetGlobalDiscardableMemoryPool();
247 247
248 pool->dumpPool(); 248 pool->dumpPool();
249 249
250 #if SK_SUPPORT_GPU 250 #if SK_SUPPORT_GPU
251 SkGLContext* glContext = this->getGLContext(); 251 SkGLContextHelper* glContext = this->getGLContext();
252 if (NULL == glContext) { 252 if (NULL == glContext) {
253 SkASSERT(kBitmap_DeviceType == fDeviceType); 253 SkASSERT(kBitmap_DeviceType == fDeviceType);
254 return; 254 return;
255 } 255 }
256 256
257 // resetState should've already done this 257 // resetState should've already done this
258 fGrContext->flush(); 258 fGrContext->flush();
259 259
260 fGrContext->purgeAllUnlockedResources(); 260 fGrContext->purgeAllUnlockedResources();
261 #endif 261 #endif
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) { 781 PictureRenderer* CreateGatherPixelRefsRenderer(const GrContext::Options& opts) {
782 return SkNEW_ARGS(GatherRenderer, (opts)); 782 return SkNEW_ARGS(GatherRenderer, (opts));
783 } 783 }
784 #else 784 #else
785 PictureRenderer* CreateGatherPixelRefsRenderer() { 785 PictureRenderer* CreateGatherPixelRefsRenderer() {
786 return SkNEW(GatherRenderer); 786 return SkNEW(GatherRenderer);
787 } 787 }
788 #endif 788 #endif
789 789
790 } // namespace sk_tools 790 } // namespace sk_tools
OLDNEW
« no previous file with comments | « tools/PictureRenderer.h ('k') | tools/timer/GpuTimer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698