Index: cc/resources/ui_resource_bitmap.cc |
diff --git a/cc/resources/ui_resource_bitmap.cc b/cc/resources/ui_resource_bitmap.cc |
index 9c42bd811fd527c1bd91db5bf0a47db538323e25..d60e0a639be879da51d6653310f5b20d6150949f 100644 |
--- a/cc/resources/ui_resource_bitmap.cc |
+++ b/cc/resources/ui_resource_bitmap.cc |
@@ -9,7 +9,7 @@ |
#include <memory> |
#include "base/logging.h" |
-#include "third_party/skia/include/core/SkBitmap.h" |
+#include "third_party/skia/include/core/SkImageInfo.h" |
#include "third_party/skia/include/core/SkMallocPixelRef.h" |
#include "third_party/skia/include/core/SkPixelRef.h" |
@@ -50,6 +50,14 @@ void UIResourceBitmap::Create(sk_sp<SkPixelRef> pixel_ref, |
opaque_ = (format == ETC1); |
} |
+void UIResourceBitmap::Draw(SkCanvas& canvas, SkPaint& paint) { |
+ SkBitmap bitmap; |
+ bitmap.setInfo(pixel_ref_.get()->info(), pixel_ref_.get()->rowBytes()); |
+ bitmap.setPixelRef(pixel_ref_.get()); |
+ canvas.drawBitmap(bitmap, 0, 0, &paint); |
+ canvas.flush(); |
+} |
+ |
UIResourceBitmap::UIResourceBitmap(const SkBitmap& skbitmap) { |
DCHECK_EQ(skbitmap.width(), skbitmap.rowBytesAsPixels()); |
DCHECK(skbitmap.isImmutable()); |