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

Unified Diff: gm/image_pict.cpp

Issue 1294113003: widen gm to show entire image, add place-holder for no context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/image_pict.cpp
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 010173974e33ee1358e291edab638716318e7275..22b3d0067b888ca6e38e0ac5ab42b1bcd2405071 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -199,7 +199,7 @@ protected:
}
SkISize onISize() override {
- return SkISize::Make(850, 450);
+ return SkISize::Make(960, 450);
}
void onOnceBeforeDraw() override {
@@ -240,6 +240,14 @@ protected:
SkAutoTUnref<GrTexture> texture(cache->lockAsTexture(canvas->getGrContext(),
kUntiled_SkImageUsageType));
if (!texture) {
+ // show placeholder if we have no texture
+ SkPaint paint;
+ paint.setStyle(SkPaint::kStroke_Style);
+ SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width()),
+ SkIntToScalar(cache->info().width()));
+ canvas->drawRect(r, paint);
+ canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint);
+ canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint);
return;
}
// No API to draw a GrTexture directly, so we cheat and create a private image subclass
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698