Commit 3e195934 authored by wez@chromium.org's avatar wez@chromium.org

Disable rendering on up-scale.

BUG=116138


Review URL: http://codereview.chromium.org/9583020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124868 0039d316-1c4b-4281-b951-d872f2087c98
parent 15e3a9de
...@@ -121,6 +121,15 @@ void DecoderVp8::RenderFrame(const SkISize& view_size, ...@@ -121,6 +121,15 @@ void DecoderVp8::RenderFrame(const SkISize& view_size,
SkRegion* output_region) { SkRegion* output_region) {
SkIRect source_clip = SkIRect::MakeWH(last_image_->d_w, last_image_->d_h); SkIRect source_clip = SkIRect::MakeWH(last_image_->d_w, last_image_->d_h);
// ScaleYUVToRGB32WithRect doesn't support up-scaling, and our web-app never
// intentionally up-scales, so if we see up-scaling (e.g. during host resize
// or if the user applies page zoom) just don't render anything.
// TODO(wez): Remove this hack when ScaleYUVToRGB32WithRect can up-scale.
if (source_clip.width() < view_size.width() ||
source_clip.height() < view_size.height()) {
return;
}
for (SkRegion::Iterator i(updated_region_); !i.done(); i.next()) { for (SkRegion::Iterator i(updated_region_); !i.done(); i.next()) {
// Determine the scaled area affected by this rectangle changing. // Determine the scaled area affected by this rectangle changing.
SkIRect rect = i.rect(); SkIRect rect = i.rect();
......
...@@ -139,19 +139,12 @@ void PepperView::SetConnectionState(protocol::ConnectionToHost::State state, ...@@ -139,19 +139,12 @@ void PepperView::SetConnectionState(protocol::ConnectionToHost::State state,
} }
} }
void PepperView::SetView(const SkISize& view_size, void PepperView::SetView(const SkISize& view_size, const SkIRect& clip_area) {
const SkIRect& clip_area) {
bool view_changed = false; bool view_changed = false;
// TODO(alexeypa): Prevent upscaling because the YUV-to-RGB conversion code if (view_size_ != view_size) {
// currently does not support upscaling. Once it does, this code be removed.
SkISize size = SkISize::Make(
std::min(view_size.width(), source_size_.width()),
std::min(view_size.height(), source_size_.height()));
if (view_size_ != size) {
view_changed = true; view_changed = true;
view_size_ = size; view_size_ = view_size;
pp::Size pp_size = pp::Size(view_size_.width(), view_size_.height()); pp::Size pp_size = pp::Size(view_size_.width(), view_size_.height());
graphics2d_ = pp::Graphics2D(instance_, pp_size, true); graphics2d_ = pp::Graphics2D(instance_, pp_size, true);
......
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