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

Unified Diff: gm/multipicturedraw.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT again Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/gmmain.cpp ('k') | gm/optimizations.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/multipicturedraw.cpp
diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp
index 2da1ab6c5dc6daee388484e2d2f1f11f4e63dd23..11756a79a7a4276388160ac17df929653a84800c 100644
--- a/gm/multipicturedraw.cpp
+++ b/gm/multipicturedraw.cpp
@@ -52,7 +52,8 @@ static const SkPicture* make_picture(SkColor fillColor) {
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(kPicWidth, kPicHeight);
+ SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
+ SkIntToScalar(kPicHeight));
SkScalar xPos, yPos = 0;
@@ -111,7 +112,7 @@ static void no_clip(SkCanvas* canvas, const SkPicture* pictures[2]) {
static void rect_clip(SkCanvas* canvas, const SkPicture* pictures[2]) {
canvas->drawPicture(pictures[0]);
- SkRect rect = SkRect::MakeWH(SkIntToScalar(kPicWidth), SkIntToScalar(kPicHeight));
+ SkRect rect = pictures[0]->cullRect();
rect.inset(kInset, kInset);
canvas->clipRect(rect);
@@ -123,7 +124,7 @@ static void rect_clip(SkCanvas* canvas, const SkPicture* pictures[2]) {
static void rrect_clip(SkCanvas* canvas, const SkPicture* pictures[2]) {
canvas->drawPicture(pictures[0]);
- SkRect rect = SkRect::MakeWH(SkIntToScalar(kPicWidth), SkIntToScalar(kPicHeight));
+ SkRect rect = pictures[0]->cullRect();
rect.inset(kInset, kInset);
SkRRect rrect;
@@ -175,7 +176,8 @@ static void create_content(SkMultiPictureDraw* mpd, PFContentMtd pfGen,
{
SkPictureRecorder recorder;
- SkCanvas* pictureCanvas = recorder.beginRecording(kPicWidth, kPicHeight);
+ SkCanvas* pictureCanvas = recorder.beginRecording(SkIntToScalar(kPicWidth),
+ SkIntToScalar(kPicHeight));
(*pfGen)(pictureCanvas, pictures);
@@ -299,7 +301,7 @@ namespace skiagm {
fPictures[1] = make_picture(SK_ColorGRAY);
}
- virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE{
+ virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkMultiPictureDraw mpd;
SkTArray<ComposeStep> composeSteps;
@@ -320,9 +322,9 @@ namespace skiagm {
}
}
- virtual SkISize onISize() SK_OVERRIDE{ return SkISize::Make(kPicWidth, kPicHeight); }
+ virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(kPicWidth, kPicHeight); }
- virtual SkString onShortName() SK_OVERRIDE{
+ virtual SkString onShortName() SK_OVERRIDE {
static const char* gContentNames[] = {
"noclip", "rectclip", "rrectclip", "pathclip", "invpathclip"
};
« no previous file with comments | « gm/gmmain.cpp ('k') | gm/optimizations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698