summaryrefslogtreecommitdiffstats
path: root/cc/resources
diff options
context:
space:
mode:
authorpowei@chromium.org <powei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 18:31:07 +0000
committerpowei@chromium.org <powei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 18:31:07 +0000
commit80ee233f3cb421f76ae537e5e9583f4d911e731c (patch)
treee0367e3a2f5eb161cbd758281317122b0e280fdf /cc/resources
parent700e657f67f4b8413c40d4e27d451695b540f37b (diff)
downloadchromium_src-80ee233f3cb421f76ae537e5e9583f4d911e731c.zip
chromium_src-80ee233f3cb421f76ae537e5e9583f4d911e731c.tar.gz
chromium_src-80ee233f3cb421f76ae537e5e9583f4d911e731c.tar.bz2
android: Migrate old content readback to use async readback (and delegated renderer)
This patch removes the use of a helper context for content readback. Instead, we use the async readback API. This patch is also setting delegated renderer as the default for android. android= https://chrome-internal-review.googlesource.com/#/c/153746/ BUG=326363 TBR=sievers@chromium.org NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248827 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=249081 Review URL: https://codereview.chromium.org/143803004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r--cc/resources/ui_resource_bitmap.cc17
-rw-r--r--cc/resources/ui_resource_bitmap.h3
2 files changed, 12 insertions, 8 deletions
diff --git a/cc/resources/ui_resource_bitmap.cc b/cc/resources/ui_resource_bitmap.cc
index b84eb8e..562e13a 100644
--- a/cc/resources/ui_resource_bitmap.cc
+++ b/cc/resources/ui_resource_bitmap.cc
@@ -13,14 +13,14 @@
namespace cc {
void UIResourceBitmap::Create(const skia::RefPtr<SkPixelRef>& pixel_ref,
+ gfx::Size size,
UIResourceFormat format) {
- const SkImageInfo& info = pixel_ref->info();
- DCHECK(info.fWidth);
- DCHECK(info.fHeight);
+ DCHECK(size.width());
+ DCHECK(size.height());
DCHECK(pixel_ref);
DCHECK(pixel_ref->isImmutable());
format_ = format;
- size_ = gfx::Size(info.fWidth, info.fHeight);
+ size_ = size;
pixel_ref_ = pixel_ref;
// Default values for secondary parameters.
@@ -34,13 +34,16 @@ UIResourceBitmap::UIResourceBitmap(const SkBitmap& skbitmap) {
DCHECK(skbitmap.isImmutable());
skia::RefPtr<SkPixelRef> pixel_ref = skia::SharePtr(skbitmap.pixelRef());
- Create(pixel_ref, UIResourceBitmap::RGBA8);
+ const SkImageInfo& info = pixel_ref->info();
+ Create(
+ pixel_ref, gfx::Size(info.fWidth, info.fHeight), UIResourceBitmap::RGBA8);
SetOpaque(skbitmap.isOpaque());
}
-UIResourceBitmap::UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref) {
- Create(pixel_ref, UIResourceBitmap::ETC1);
+UIResourceBitmap::UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref,
+ gfx::Size size) {
+ Create(pixel_ref, size, UIResourceBitmap::ETC1);
}
UIResourceBitmap::~UIResourceBitmap() {}
diff --git a/cc/resources/ui_resource_bitmap.h b/cc/resources/ui_resource_bitmap.h
index 64e962c..2cce0b3 100644
--- a/cc/resources/ui_resource_bitmap.h
+++ b/cc/resources/ui_resource_bitmap.h
@@ -44,13 +44,14 @@ class CC_EXPORT UIResourceBitmap {
// User must ensure that |skbitmap| is immutable. The SkBitmap Format should
// be 32-bit RGBA.
explicit UIResourceBitmap(const SkBitmap& skbitmap);
- explicit UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref);
+ UIResourceBitmap(const skia::RefPtr<SkPixelRef>& pixel_ref, gfx::Size size);
~UIResourceBitmap();
private:
friend class AutoLockUIResourceBitmap;
void Create(const skia::RefPtr<SkPixelRef>& pixel_ref,
+ gfx::Size size,
UIResourceFormat format);
skia::RefPtr<SkPixelRef> pixel_ref_;