Commit b5524e54 authored by skuhne's avatar skuhne Committed by Commit bot

Fixing issues with new activity image readback

While writing the unit tests I have found problems and fixed them. Since I am not sure when the unit tests will land however (they come with the new Athena Browser test framework) I created this patch to get a workable version for Sadrul's Overview mode work.

BUG=408837
TEST=tests are in different CL which introduces Browser Tests for Athena

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

Cr-Commit-Position: refs/heads/master@{#297193}
parent b2ea4647
...@@ -82,12 +82,12 @@ void ContentProxy::ContentWillUnload() { ...@@ -82,12 +82,12 @@ void ContentProxy::ContentWillUnload() {
gfx::ImageSkia ContentProxy::GetContentImage() { gfx::ImageSkia ContentProxy::GetContentImage() {
// While we compress to PNG, we use the original read back. // While we compress to PNG, we use the original read back.
if (!raw_image_.isNull() || !png_data_.get()) if (!png_data_.get())
return raw_image_; return raw_image_;
// Otherwise we convert the PNG. // Otherwise we convert the PNG.
std::vector<gfx::ImagePNGRep> image_reps; std::vector<gfx::ImagePNGRep> image_reps;
image_reps.push_back(gfx::ImagePNGRep(png_data_, 0.0f)); image_reps.push_back(gfx::ImagePNGRep(png_data_, 1.0f));
return *(gfx::Image(image_reps).ToImageSkia()); return *(gfx::Image(image_reps).ToImageSkia());
} }
......
...@@ -558,7 +558,7 @@ views::Widget* WebActivity::CreateWidget() { ...@@ -558,7 +558,7 @@ views::Widget* WebActivity::CreateWidget() {
gfx::ImageSkia WebActivity::GetOverviewModeImage() { gfx::ImageSkia WebActivity::GetOverviewModeImage() {
if (content_proxy_.get()) if (content_proxy_.get())
content_proxy_->GetContentImage(); return content_proxy_->GetContentImage();
return gfx::ImageSkia(); return gfx::ImageSkia();
} }
......
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