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

Unified Diff: cc/image_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/image_layer_updater.h ('k') | cc/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/image_layer_updater.cc
diff --git a/cc/image_layer_updater.cc b/cc/image_layer_updater.cc
deleted file mode 100644
index 04db9aa956024c89361ff6388af57d68a10b9e8a..0000000000000000000000000000000000000000
--- a/cc/image_layer_updater.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2012 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/image_layer_updater.h"
-#include "cc/prioritized_resource.h"
-#include "cc/resource_update_queue.h"
-
-namespace cc {
-
-ImageLayerUpdater::Resource::Resource(ImageLayerUpdater* updater,
- scoped_ptr<PrioritizedResource> texture)
- : LayerUpdater::Resource(texture.Pass()), updater_(updater) {}
-
-ImageLayerUpdater::Resource::~Resource() {}
-
-void ImageLayerUpdater::Resource::Update(ResourceUpdateQueue* queue,
- gfx::Rect source_rect,
- gfx::Vector2d dest_offset,
- bool partial_update,
- RenderingStats*) {
- updater_->UpdateTexture(
- queue, texture(), source_rect, dest_offset, partial_update);
-}
-
-// static
-scoped_refptr<ImageLayerUpdater> ImageLayerUpdater::Create() {
- return make_scoped_refptr(new ImageLayerUpdater());
-}
-
-scoped_ptr<LayerUpdater::Resource> ImageLayerUpdater::CreateResource(
- PrioritizedResourceManager* manager) {
- return scoped_ptr<LayerUpdater::Resource>(
- new Resource(this, PrioritizedResource::create(manager)));
-}
-
-void ImageLayerUpdater::UpdateTexture(ResourceUpdateQueue* queue,
- PrioritizedResource* texture,
- gfx::Rect source_rect,
- gfx::Vector2d dest_offset,
- bool partial_update) {
- // Source rect should never go outside the image pixels, even if this
- // is requested because the texture extends outside the image.
- gfx::Rect clipped_source_rect = source_rect;
- gfx::Rect image_rect = gfx::Rect(0, 0, bitmap_.width(), bitmap_.height());
- clipped_source_rect.Intersect(image_rect);
-
- gfx::Vector2d clipped_dest_offset =
- dest_offset +
- gfx::Vector2d(clipped_source_rect.origin() - source_rect.origin());
-
- ResourceUpdate upload = ResourceUpdate::Create(
- texture, &bitmap_, image_rect, clipped_source_rect, clipped_dest_offset);
- if (partial_update)
- queue->appendPartialUpload(upload);
- else
- queue->appendFullUpload(upload);
-}
-
-}
« no previous file with comments | « cc/image_layer_updater.h ('k') | cc/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698