| 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..c730c0e5e8987dd39cc98edf53f25cb02a45bd01 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::DrawToCanvas(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());
|
|
|