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

Unified Diff: cc/tiles/software_image_decode_controller.h

Issue 1900953004: Switch DrawImage to sk_sp<> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Florin's nit Created 4 years, 8 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 | « cc/tiles/gpu_image_decode_controller_unittest.cc ('k') | cc/tiles/software_image_decode_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/software_image_decode_controller.h
diff --git a/cc/tiles/software_image_decode_controller.h b/cc/tiles/software_image_decode_controller.h
index fe55d88b670bdff9bb42be2ca73ae4115610681f..6f42afed9cb6eea0a49690ead39e0c3f35b4a596 100644
--- a/cc/tiles/software_image_decode_controller.h
+++ b/cc/tiles/software_image_decode_controller.h
@@ -24,7 +24,7 @@
#include "cc/playback/draw_image.h"
#include "cc/resources/resource_format.h"
#include "cc/tiles/image_decode_controller.h"
-#include "skia/ext/refptr.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
namespace cc {
@@ -141,9 +141,9 @@ class CC_EXPORT SoftwareImageDecodeController
uint64_t tracing_id);
~DecodedImage();
- SkImage* image() const {
+ const sk_sp<SkImage>& image() const {
DCHECK(locked_);
- return image_.get();
+ return image_;
}
const SkSize& src_rect_offset() const { return src_rect_offset_; }
@@ -162,7 +162,7 @@ class CC_EXPORT SoftwareImageDecodeController
bool locked_;
SkImageInfo image_info_;
std::unique_ptr<base::DiscardableMemory> memory_;
- skia::RefPtr<SkImage> image_;
+ sk_sp<SkImage> image_;
SkSize src_rect_offset_;
uint64_t tracing_id_;
};
@@ -214,15 +214,17 @@ class CC_EXPORT SoftwareImageDecodeController
// GetOriginalImageDecode is called by DecodeImageInternal when the quality
// does not scale the image. Like DecodeImageInternal, it should be called
// with no lock acquired and it returns nullptr if the decoding failed.
- std::unique_ptr<DecodedImage> GetOriginalImageDecode(const ImageKey& key,
- const SkImage& image);
+ std::unique_ptr<DecodedImage> GetOriginalImageDecode(
+ const ImageKey& key,
+ sk_sp<const SkImage> image);
danakj 2016/04/22 20:36:04 I think florin was against saying const for these?
// GetScaledImageDecode is called by DecodeImageInternal when the quality
// requires the image be scaled. Like DecodeImageInternal, it should be
// called with no lock acquired and it returns nullptr if the decoding or
// scaling failed.
- std::unique_ptr<DecodedImage> GetScaledImageDecode(const ImageKey& key,
- const SkImage& image);
+ std::unique_ptr<DecodedImage> GetScaledImageDecode(
+ const ImageKey& key,
+ sk_sp<const SkImage> image);
void SanityCheckState(int line, bool lock_acquired);
void RefImage(const ImageKey& key);
« no previous file with comments | « cc/tiles/gpu_image_decode_controller_unittest.cc ('k') | cc/tiles/software_image_decode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698