summaryrefslogtreecommitdiffstats
path: root/cc/layers/picture_image_layer_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/layers/picture_image_layer_impl.cc')
-rw-r--r--cc/layers/picture_image_layer_impl.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/cc/layers/picture_image_layer_impl.cc b/cc/layers/picture_image_layer_impl.cc
new file mode 100644
index 0000000..9c478f0
--- /dev/null
+++ b/cc/layers/picture_image_layer_impl.cc
@@ -0,0 +1,45 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/layers/picture_image_layer_impl.h"
+
+#include "cc/debug/debug_colors.h"
+#include "cc/trees/layer_tree_impl.h"
+
+namespace cc {
+
+PictureImageLayerImpl::PictureImageLayerImpl(LayerTreeImpl* treeImpl, int id)
+ : PictureLayerImpl(treeImpl, id) {
+}
+
+PictureImageLayerImpl::~PictureImageLayerImpl() {
+}
+
+const char* PictureImageLayerImpl::LayerTypeAsString() const {
+ return "PictureImageLayer";
+}
+
+scoped_ptr<LayerImpl> PictureImageLayerImpl::CreateLayerImpl(
+ LayerTreeImpl* treeImpl) {
+ return PictureImageLayerImpl::Create(treeImpl, id()).PassAs<LayerImpl>();
+}
+
+void PictureImageLayerImpl::GetDebugBorderProperties(
+ SkColor* color, float* width) const {
+ *color = DebugColors::ImageLayerBorderColor();
+ *width = DebugColors::ImageLayerBorderWidth(layer_tree_impl());
+}
+
+void PictureImageLayerImpl::CalculateRasterContentsScale(
+ bool animating_transform_to_screen,
+ float* raster_contents_scale,
+ float* low_res_raster_contents_scale) {
+ // Don't scale images during rastering to ensure image quality, save memory
+ // and avoid frequent re-rastering on change of scale.
+ *raster_contents_scale = std::max(1.f, MinimumContentsScale());
+ // We don't need low res tiles.
+ *low_res_raster_contents_scale = *raster_contents_scale;
+}
+
+} // namespace cc