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

Unified Diff: trunk/src/cc/resources/ui_resource_bitmap.cc

Issue 23740010: Revert 223162 "Update the nine patch layer to use UI resources" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 | « trunk/src/cc/resources/ui_resource_bitmap.h ('k') | trunk/src/cc/resources/ui_resource_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/resources/ui_resource_bitmap.cc
===================================================================
--- trunk/src/cc/resources/ui_resource_bitmap.cc (revision 223178)
+++ trunk/src/cc/resources/ui_resource_bitmap.cc (working copy)
@@ -4,45 +4,25 @@
#include "cc/resources/ui_resource_bitmap.h"
-#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "third_party/skia/include/core/SkBitmap.h"
namespace cc {
-uint8_t* UIResourceBitmap::GetPixels() const {
- if (!pixel_ref_)
- return NULL;
- return static_cast<uint8_t*>(pixel_ref_->pixels());
-}
+scoped_refptr<UIResourceBitmap>
+UIResourceBitmap::Create(uint8_t* pixels,
+ UIResourceFormat format,
+ UIResourceWrapMode wrap_mode,
+ gfx::Size size) {
+ scoped_refptr<UIResourceBitmap> ret = new UIResourceBitmap();
+ ret->pixels_ = scoped_ptr<uint8_t[]>(pixels);
+ ret->format_ = format;
+ ret->wrap_mode_ = wrap_mode;
+ ret->size_ = size;
-void UIResourceBitmap::Create(const skia::RefPtr<SkPixelRef>& pixel_ref,
- UIResourceFormat format,
- UIResourceWrapMode wrap_mode,
- gfx::Size size) {
- DCHECK(size.width());
- DCHECK(size.height());
- DCHECK(pixel_ref);
- DCHECK(pixel_ref->isImmutable());
- format_ = format;
- wrap_mode_ = wrap_mode;
- size_ = size;
- pixel_ref_ = pixel_ref;
+ return ret;
}
-UIResourceBitmap::UIResourceBitmap(const SkBitmap& skbitmap,
- UIResourceWrapMode wrap_mode) {
- DCHECK_EQ(skbitmap.config(), SkBitmap::kARGB_8888_Config);
- DCHECK_EQ(skbitmap.width(), skbitmap.rowBytesAsPixels());
- DCHECK(skbitmap.isImmutable());
-
- skia::RefPtr<SkPixelRef> pixel_ref = skia::SharePtr(skbitmap.pixelRef());
- Create(pixel_ref,
- UIResourceBitmap::RGBA8,
- wrap_mode,
- gfx::Size(skbitmap.width(), skbitmap.height()));
-}
-
+UIResourceBitmap::UIResourceBitmap() {}
UIResourceBitmap::~UIResourceBitmap() {}
} // namespace cc
« no previous file with comments | « trunk/src/cc/resources/ui_resource_bitmap.h ('k') | trunk/src/cc/resources/ui_resource_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698