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

Unified Diff: cc/bitmap_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_content_layer_updater.h ('k') | cc/bitmap_skpicture_content_layer_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/bitmap_content_layer_updater.cc
diff --git a/cc/bitmap_content_layer_updater.cc b/cc/bitmap_content_layer_updater.cc
deleted file mode 100644
index 19d491224ff901aa2f440b4f901c44d14146143f..0000000000000000000000000000000000000000
--- a/cc/bitmap_content_layer_updater.cc
+++ /dev/null
@@ -1,100 +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_content_layer_updater.h"
-
-#include "cc/debug/rendering_stats.h"
-#include "cc/layer_painter.h"
-#include "cc/prioritized_resource.h"
-#include "cc/resource_update.h"
-#include "cc/resource_update_queue.h"
-#include "skia/ext/platform_canvas.h"
-
-namespace cc {
-
-BitmapContentLayerUpdater::Resource::Resource(
- BitmapContentLayerUpdater* updater,
- scoped_ptr<PrioritizedResource> texture)
- : LayerUpdater::Resource(texture.Pass()), updater_(updater) {}
-
-BitmapContentLayerUpdater::Resource::~Resource() {}
-
-void BitmapContentLayerUpdater::Resource::Update(ResourceUpdateQueue* queue,
- gfx::Rect source_rect,
- gfx::Vector2d dest_offset,
- bool partial_update,
- RenderingStats* stats) {
- updater_->UpdateTexture(
- queue, texture(), source_rect, dest_offset, partial_update);
-}
-
-scoped_refptr<BitmapContentLayerUpdater> BitmapContentLayerUpdater::Create(
- scoped_ptr<LayerPainter> painter) {
- return make_scoped_refptr(new BitmapContentLayerUpdater(painter.Pass()));
-}
-
-BitmapContentLayerUpdater::BitmapContentLayerUpdater(
- scoped_ptr<LayerPainter> painter)
- : ContentLayerUpdater(painter.Pass()), opaque_(false) {}
-
-BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {}
-
-scoped_ptr<LayerUpdater::Resource> BitmapContentLayerUpdater::CreateResource(
- PrioritizedResourceManager* manager) {
- return scoped_ptr<LayerUpdater::Resource>(
- new Resource(this, PrioritizedResource::create(manager)));
-}
-
-void BitmapContentLayerUpdater::PrepareToUpdate(
- gfx::Rect content_rect,
- gfx::Size tile_size,
- float contents_width_scale,
- float contents_height_scale,
- gfx::Rect* resulting_opaque_rect,
- RenderingStats* stats) {
- if (canvas_size_ != content_rect.size()) {
- canvas_size_ = content_rect.size();
- canvas_ = make_scoped_ptr(skia::CreateBitmapCanvas(
- canvas_size_.width(), canvas_size_.height(), opaque_));
- }
-
- if (stats) {
- stats->totalPixelsRasterized +=
- content_rect.width() * content_rect.height();
- }
-
- PaintContents(canvas_.get(),
- content_rect,
- contents_width_scale,
- contents_height_scale,
- resulting_opaque_rect,
- stats);
-}
-
-void BitmapContentLayerUpdater::UpdateTexture(ResourceUpdateQueue* queue,
- PrioritizedResource* texture,
- gfx::Rect source_rect,
- gfx::Vector2d dest_offset,
- bool partial_update) {
- ResourceUpdate upload =
- ResourceUpdate::Create(texture,
- &canvas_->getDevice()->accessBitmap(false),
- content_rect(),
- source_rect,
- dest_offset);
- if (partial_update)
- queue->appendPartialUpload(upload);
- else
- queue->appendFullUpload(upload);
-}
-
-void BitmapContentLayerUpdater::SetOpaque(bool opaque) {
- if (opaque != opaque_) {
- canvas_.reset();
- canvas_size_ = gfx::Size();
- }
- opaque_ = opaque;
-}
-
-} // namespace cc
« no previous file with comments | « cc/bitmap_content_layer_updater.h ('k') | cc/bitmap_skpicture_content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698