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

Unified Diff: cc/resources/ui_resource_bitmap.cc

Issue 138393002: replace etc1_pixel_ref with skia version (SkMallocPixelRef) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « cc/resources/ui_resource_bitmap.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/ui_resource_bitmap.cc
diff --git a/cc/resources/ui_resource_bitmap.cc b/cc/resources/ui_resource_bitmap.cc
index b813d973537e1b4534298e9898fc85a1ebd9ae08..b84eb8e097cc2bb290cfd5545044c1de54dd3875 100644
--- a/cc/resources/ui_resource_bitmap.cc
+++ b/cc/resources/ui_resource_bitmap.cc
@@ -6,21 +6,21 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "cc/resources/etc1_pixel_ref.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "third_party/skia/include/core/SkMallocPixelRef.h"
#include "third_party/skia/include/core/SkPixelRef.h"
namespace cc {
void UIResourceBitmap::Create(const skia::RefPtr<SkPixelRef>& pixel_ref,
- UIResourceFormat format,
- gfx::Size size) {
- DCHECK(size.width());
- DCHECK(size.height());
+ UIResourceFormat format) {
+ const SkImageInfo& info = pixel_ref->info();
+ DCHECK(info.fWidth);
+ DCHECK(info.fHeight);
DCHECK(pixel_ref);
DCHECK(pixel_ref->isImmutable());
format_ = format;
- size_ = size;
+ size_ = gfx::Size(info.fWidth, info.fHeight);
pixel_ref_ = pixel_ref;
// Default values for secondary parameters.
@@ -34,17 +34,13 @@ UIResourceBitmap::UIResourceBitmap(const SkBitmap& skbitmap) {
DCHECK(skbitmap.isImmutable());
skia::RefPtr<SkPixelRef> pixel_ref = skia::SharePtr(skbitmap.pixelRef());
- Create(pixel_ref,
- UIResourceBitmap::RGBA8,
- gfx::Size(skbitmap.width(), skbitmap.height()));
+ Create(pixel_ref, UIResourceBitmap::RGBA8);
SetOpaque(skbitmap.isOpaque());
}
-UIResourceBitmap::UIResourceBitmap(
- const skia::RefPtr<ETC1PixelRef>& etc1_pixel_ref,
- gfx::Size size) {
- Create(etc1_pixel_ref, ETC1, size);
+UIResourceBitmap::UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref) {
+ Create(pixel_ref, UIResourceBitmap::ETC1);
}
UIResourceBitmap::~UIResourceBitmap() {}
« no previous file with comments | « cc/resources/ui_resource_bitmap.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698