Commit a1a303aa authored by siva.gunturi's avatar siva.gunturi Committed by Commit bot

Allow retrieval of updated bitmaps in thumbnails.

When the thumbnails are updated using setBitmap
and setCompressedBitmap, getbitmap should return
newly updated bitmap instead of the placeholder.

BUG=410658

Review URL: https://codereview.chromium.org/1128113010

Cr-Commit-Position: refs/heads/master@{#329672}
parent fcbee438
...@@ -54,6 +54,7 @@ Thumbnail::~Thumbnail() { ...@@ -54,6 +54,7 @@ Thumbnail::~Thumbnail() {
void Thumbnail::SetBitmap(const SkBitmap& bitmap) { void Thumbnail::SetBitmap(const SkBitmap& bitmap) {
DCHECK(!bitmap.empty()); DCHECK(!bitmap.empty());
retrieved_ = false;
ClearUIResourceId(); ClearUIResourceId();
scaled_content_size_ = scaled_content_size_ =
gfx::ScaleSize(gfx::Size(bitmap.width(), bitmap.height()), 1.f / scale_); gfx::ScaleSize(gfx::Size(bitmap.width(), bitmap.height()), 1.f / scale_);
...@@ -65,6 +66,7 @@ void Thumbnail::SetCompressedBitmap(skia::RefPtr<SkPixelRef> compressed_bitmap, ...@@ -65,6 +66,7 @@ void Thumbnail::SetCompressedBitmap(skia::RefPtr<SkPixelRef> compressed_bitmap,
const gfx::Size& content_size) { const gfx::Size& content_size) {
DCHECK(compressed_bitmap); DCHECK(compressed_bitmap);
DCHECK(!content_size.IsEmpty()); DCHECK(!content_size.IsEmpty());
retrieved_ = false;
ClearUIResourceId(); ClearUIResourceId();
gfx::Size data_size(compressed_bitmap->info().width(), gfx::Size data_size(compressed_bitmap->info().width(),
compressed_bitmap->info().height()); compressed_bitmap->info().height());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment