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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1852733002: Add GrContext::releaseAndAbandonContext() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-gpu build, add null check, add unit test" Created 4 years, 8 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 | « dm/DMGpuSupport.h ('k') | include/gpu/GrContext.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 #include "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "SkAndroidCodec.h" 9 #include "SkAndroidCodec.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 } 1004 }
1005 canvas->flush(); 1005 canvas->flush();
1006 if (FLAGS_gpuStats) { 1006 if (FLAGS_gpuStats) {
1007 canvas->getGrContext()->dumpCacheStats(log); 1007 canvas->getGrContext()->dumpCacheStats(log);
1008 canvas->getGrContext()->dumpGpuStats(log); 1008 canvas->getGrContext()->dumpGpuStats(log);
1009 } 1009 }
1010 dst->allocPixels(info); 1010 dst->allocPixels(info);
1011 canvas->readPixels(dst, 0, 0); 1011 canvas->readPixels(dst, 0, 0);
1012 if (FLAGS_abandonGpuContext) { 1012 if (FLAGS_abandonGpuContext) {
1013 factory.abandonContexts(); 1013 factory.abandonContexts();
1014 } else if (FLAGS_releaseAndAbandonGpuContext) {
1015 factory.releaseResourcesAndAbandonContexts();
1014 } 1016 }
1015 return ""; 1017 return "";
1016 } 1018 }
1017 1019
1018 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 1020 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
1019 1021
1020 static Error draw_skdocument(const Src& src, SkDocument* doc, SkWStream* dst) { 1022 static Error draw_skdocument(const Src& src, SkDocument* doc, SkWStream* dst) {
1021 if (src.size().isEmpty()) { 1023 if (src.size().isEmpty()) {
1022 return "Source has empty dimensions"; 1024 return "Source has empty dimensions";
1023 } 1025 }
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 skr.visit(i, drawsAsSingletonPictures); 1511 skr.visit(i, drawsAsSingletonPictures);
1510 } 1512 }
1511 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); 1513 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture());
1512 1514
1513 canvas->drawPicture(macroPic); 1515 canvas->drawPicture(macroPic);
1514 return check_against_reference(bitmap, src, fSink); 1516 return check_against_reference(bitmap, src, fSink);
1515 }); 1517 });
1516 } 1518 }
1517 1519
1518 } // namespace DM 1520 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMGpuSupport.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698