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

Unified Diff: webkit/compositor_bindings/web_image_layer_impl.cc

Issue 12326022: Efficiently handle image layer scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win warnings Created 7 years, 10 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
Index: webkit/compositor_bindings/web_image_layer_impl.cc
diff --git a/webkit/compositor_bindings/web_image_layer_impl.cc b/webkit/compositor_bindings/web_image_layer_impl.cc
index b66d27baacb6ce2259c8662e7ca330b02cf16ba9..f4a00ed38d457c560c82a83a9d820dd6da765270 100644
--- a/webkit/compositor_bindings/web_image_layer_impl.cc
+++ b/webkit/compositor_bindings/web_image_layer_impl.cc
@@ -9,6 +9,7 @@
#include "cc/picture_image_layer.h"
#include "cc/switches.h"
#include "webkit/compositor_bindings/web_layer_impl.h"
+#include "webkit/compositor_bindings/web_layer_impl_fixed_bounds.h"
static bool usingPictureLayer()
{
@@ -20,7 +21,7 @@ namespace WebKit {
WebImageLayerImpl::WebImageLayerImpl()
{
if (usingPictureLayer())
- m_layer.reset(new WebLayerImpl(cc::PictureImageLayer::create()));
+ m_layer.reset(new WebLayerImplFixedBounds(cc::PictureImageLayer::create()));
else
m_layer.reset(new WebLayerImpl(cc::ImageLayer::create()));
}
@@ -36,9 +37,10 @@ WebLayer* WebImageLayerImpl::layer()
void WebImageLayerImpl::setBitmap(SkBitmap bitmap)
{
- if (usingPictureLayer())
+ if (usingPictureLayer()) {
static_cast<cc::PictureImageLayer*>(m_layer->layer())->setBitmap(bitmap);
- else
+ static_cast<WebLayerImplFixedBounds*>(m_layer.get())->SetFixedBounds(gfx::Size(bitmap.width(), bitmap.height()));
+ } else
static_cast<cc::ImageLayer*>(m_layer->layer())->setBitmap(bitmap);
}
« no previous file with comments | « webkit/compositor_bindings/compositor_bindings_tests.gyp ('k') | webkit/compositor_bindings/web_layer_impl_fixed_bounds.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698