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

Unified Diff: cc/bitmap_skpicture_content_layer_updater.cc

Issue 12471007: Part 8 of cc/ directory shuffles: resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« no previous file with comments | « cc/bitmap_skpicture_content_layer_updater.h ('k') | cc/caching_bitmap_content_layer_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/bitmap_skpicture_content_layer_updater.cc
diff --git a/cc/bitmap_skpicture_content_layer_updater.cc b/cc/bitmap_skpicture_content_layer_updater.cc
deleted file mode 100644
index 77949a5c435ee7127bcb2f388780f890f01a48ce..0000000000000000000000000000000000000000
--- a/cc/bitmap_skpicture_content_layer_updater.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2011 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/bitmap_skpicture_content_layer_updater.h"
-
-#include "base/time.h"
-#include "cc/debug/rendering_stats.h"
-#include "cc/layer_painter.h"
-#include "cc/prioritized_resource.h"
-#include "cc/resource_update_queue.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkDevice.h"
-
-namespace cc {
-
-BitmapSkPictureContentLayerUpdater::Resource::Resource(
- BitmapSkPictureContentLayerUpdater* updater,
- scoped_ptr<PrioritizedResource> texture)
- : ContentLayerUpdater::Resource(texture.Pass()), updater_(updater) {}
-
-void BitmapSkPictureContentLayerUpdater::Resource::Update(
- ResourceUpdateQueue* queue,
- gfx::Rect source_rect,
- gfx::Vector2d dest_offset,
- bool partial_update,
- RenderingStats* stats) {
- bitmap_.setConfig(
- SkBitmap::kARGB_8888_Config, source_rect.width(), source_rect.height());
- bitmap_.allocPixels();
- bitmap_.setIsOpaque(updater_->layer_is_opaque());
- SkDevice device(bitmap_);
- SkCanvas canvas(&device);
- base::TimeTicks paint_begin_time;
- if (stats)
- paint_begin_time = base::TimeTicks::Now();
- updater_->PaintContentsRect(&canvas, source_rect, stats);
- if (stats)
- stats->totalPaintTime += base::TimeTicks::Now() - paint_begin_time;
-
- ResourceUpdate upload = ResourceUpdate::Create(
- texture(), &bitmap_, source_rect, source_rect, dest_offset);
- if (partial_update)
- queue->appendPartialUpload(upload);
- else
- queue->appendFullUpload(upload);
-}
-
-scoped_refptr<BitmapSkPictureContentLayerUpdater>
-BitmapSkPictureContentLayerUpdater::Create(scoped_ptr<LayerPainter> painter) {
- return make_scoped_refptr(
- new BitmapSkPictureContentLayerUpdater(painter.Pass()));
-}
-
-BitmapSkPictureContentLayerUpdater::BitmapSkPictureContentLayerUpdater(
- scoped_ptr<LayerPainter> painter)
- : SkPictureContentLayerUpdater(painter.Pass()) {}
-
-BitmapSkPictureContentLayerUpdater::~BitmapSkPictureContentLayerUpdater() {}
-
-scoped_ptr<LayerUpdater::Resource>
-BitmapSkPictureContentLayerUpdater::CreateResource(
- PrioritizedResourceManager* manager) {
- return scoped_ptr<LayerUpdater::Resource>(
- new Resource(this, PrioritizedResource::create(manager)));
-}
-
-void BitmapSkPictureContentLayerUpdater::PaintContentsRect(
- SkCanvas* canvas,
- gfx::Rect source_rect,
- RenderingStats* stats) {
- // Translate the origin of content_rect to that of source_rect.
- canvas->translate(content_rect().x() - source_rect.x(),
- content_rect().y() - source_rect.y());
- base::TimeTicks rasterize_begin_time;
- if (stats)
- rasterize_begin_time = base::TimeTicks::Now();
- DrawPicture(canvas);
- if (stats) {
- stats->totalRasterizeTime += base::TimeTicks::Now() - rasterize_begin_time;
- stats->totalPixelsRasterized += source_rect.width() * source_rect.height();
- }
-}
-
-} // namespace cc
« no previous file with comments | « cc/bitmap_skpicture_content_layer_updater.h ('k') | cc/caching_bitmap_content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698