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

Unified Diff: src/gpu/GrRecordReplaceDraw.cpp

Issue 1584933002: Refactor to use GrWrapTextureInBitmap more (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-gpu build Created 4 years, 11 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 | « src/gpu/GrLayerHoister.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRecordReplaceDraw.cpp
diff --git a/src/gpu/GrRecordReplaceDraw.cpp b/src/gpu/GrRecordReplaceDraw.cpp
index 28f27dfc1c7821642a18a3f2050e8954a7a71a21..1fe60407895ac8bebe67d3f24687c6ad0c4d4b8a 100644
--- a/src/gpu/GrRecordReplaceDraw.cpp
+++ b/src/gpu/GrRecordReplaceDraw.cpp
@@ -10,16 +10,11 @@
#include "GrRecordReplaceDraw.h"
#include "SkBigPicture.h"
#include "SkCanvasPriv.h"
-#include "SkGrPixelRef.h"
+#include "SkGr.h"
#include "SkImage.h"
#include "SkRecordDraw.h"
#include "SkRecords.h"
-static inline void wrap_texture(GrTexture* texture, int width, int height, SkBitmap* result) {
- SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
- result->setInfo(info);
- result->setPixelRef(new SkGrPixelRef(info, texture))->unref();
-}
static inline void draw_replacement_bitmap(GrCachedLayer* layer, SkCanvas* canvas) {
@@ -30,10 +25,11 @@ static inline void draw_replacement_bitmap(GrCachedLayer* layer, SkCanvas* canva
}
SkBitmap bm;
- wrap_texture(layer->texture(),
- !layer->isAtlased() ? layer->rect().width() : layer->texture()->width(),
- !layer->isAtlased() ? layer->rect().height() : layer->texture()->height(),
- &bm);
+ GrWrapTextureInBitmap(layer->texture(),
+ !layer->isAtlased() ? layer->rect().width() : layer->texture()->width(),
+ !layer->isAtlased() ? layer->rect().height() : layer->texture()->height(),
+ false,
+ &bm);
canvas->save();
canvas->setMatrix(SkMatrix::I());
« no previous file with comments | « src/gpu/GrLayerHoister.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698