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

Side by Side Diff: gm/pathopsskpclip.cpp

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android Created 6 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 }; 48 };
49 p.addRoundRect(r, SkIntToScalar(50), SkIntToScalar(50)); 49 p.addRoundRect(r, SkIntToScalar(50), SkIntToScalar(50));
50 rec->clipPath(p, SkRegion::kIntersect_Op, true); 50 rec->clipPath(p, SkRegion::kIntersect_Op, true);
51 rec->translate(SkIntToScalar(250), SkIntToScalar(250)); 51 rec->translate(SkIntToScalar(250), SkIntToScalar(250));
52 rec->clipPath(p, SkRegion::kIntersect_Op, true); 52 rec->clipPath(p, SkRegion::kIntersect_Op, true);
53 rec->drawColor(0xffff0000); 53 rec->drawColor(0xffff0000);
54 SkAutoTUnref<SkPicture> pict(recorder.endRecording()); 54 SkAutoTUnref<SkPicture> pict(recorder.endRecording());
55 55
56 canvas->setAllowSimplifyClip(true); 56 canvas->setAllowSimplifyClip(true);
57 canvas->save(); 57 canvas->save();
58 canvas->drawPicture(*pict); 58 canvas->drawPicture(pict);
59 canvas->restore(); 59 canvas->restore();
60 60
61 canvas->setAllowSimplifyClip(false); 61 canvas->setAllowSimplifyClip(false);
62 canvas->save(); 62 canvas->save();
63 canvas->translate(SkIntToScalar(1200 / 2), 0); 63 canvas->translate(SkIntToScalar(1200 / 2), 0);
64 canvas->drawPicture(*pict); 64 canvas->drawPicture(pict);
65 canvas->restore(); 65 canvas->restore();
66 } 66 }
67 67
68 private: 68 private:
69 typedef GM INHERITED; 69 typedef GM INHERITED;
70 }; 70 };
71 71
72 ////////////////////////////////////////////////////////////////////////////// 72 //////////////////////////////////////////////////////////////////////////////
73 73
74 static GM* MyFactory(void*) { return new PathOpsSkpClipGM; } 74 static GM* MyFactory(void*) { return new PathOpsSkpClipGM; }
75 static GMRegistry reg(MyFactory); 75 static GMRegistry reg(MyFactory);
76 76
77 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698