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

Unified Diff: gm/drawbitmaprect.cpp

Issue 2148793003: Stop testing texture-backed bitmaps in drawbitmaprect GM (Closed) Base URL: https://chromium.googlesource.com/skia.git@hidegrwrap
Patch Set: Created 4 years, 5 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/drawbitmaprect.cpp
diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp
index f990097c5d82d538934c49c1e292f4307867cf7a..0747ab0910e36aea612bf346d38ae88a931ebd0f 100644
--- a/gm/drawbitmaprect.cpp
+++ b/gm/drawbitmaprect.cpp
@@ -16,9 +16,6 @@
#include "SkShader.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
-#include "SkGrPriv.h"
-#endif
static SkBitmap make_chessbm(int w, int h) {
SkBitmap bm;
@@ -34,6 +31,7 @@ static SkBitmap make_chessbm(int w, int h) {
return bm;
}
+// Creates a bitmap and a matching image.
static sk_sp<SkImage> makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, int h) {
SkImageInfo info = SkImageInfo::MakeN32Premul(w, h);
@@ -86,14 +84,7 @@ static sk_sp<SkImage> makebm(SkCanvas* origCanvas, SkBitmap* resultBM, int w, in
SkBitmap tempBM;
-#if SK_SUPPORT_GPU
- if (GrTexture* texture = as_IB(image)->peekTexture()) {
- GrWrapTextureInBitmap(texture, image->width(), image->height(), image->isOpaque(), &tempBM);
- } else
-#endif
- {
- image->asLegacyBitmap(&tempBM, SkImage::kRO_LegacyBitmapMode);
- }
+ image->asLegacyBitmap(&tempBM, SkImage::kRO_LegacyBitmapMode);
// Let backends know we won't change this, so they don't have to deep copy it defensively.
tempBM.setImmutable();
@@ -152,7 +143,7 @@ protected:
static const int kPadY = 40;
SkPaint paint;
paint.setAlpha(0x20);
- canvas->drawBitmapRect(fLargeBitmap, SkRect::MakeIWH(gSize, gSize), &paint);
bsalomon 2016/07/13 21:13:08 The GM was (arbitrarily) always using the bitmap r
+ canvas->drawImageRect(fImage, SkRect::MakeIWH(gSize, gSize), &paint);
canvas->translate(SK_Scalar1 * kPadX / 2,
SK_Scalar1 * kPadY / 2);
SkPaint blackPaint;
« 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