forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cc: Rename LayerTextureUpdater to LayerUpdater.
sed -e ' s/TextureUpdater/Updater/g s/textureUpdater/updater/g s/texture_updater\.h/updater.h/g s/texture_updater\.cc/updater.cc/g s/TEXTURE_UPDATER_H_/UPDATER_H_/g ' BUG= TEST=cc_unittests Review URL: https://codereview.chromium.org/11231082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163615 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
reveman@google.com
committed
Oct 23, 2012
1 parent
589029c
commit 64d8d39
Showing
29 changed files
with
530 additions
and
530 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// 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 "config.h" | ||
|
||
#include "cc/bitmap_canvas_layer_updater.h" | ||
|
||
#include "cc/layer_painter.h" | ||
#include "cc/resource_update.h" | ||
#include "cc/texture_update_queue.h" | ||
#include "skia/ext/platform_canvas.h" | ||
|
||
namespace cc { | ||
|
||
BitmapCanvasLayerUpdater::Texture::Texture(BitmapCanvasLayerUpdater* updater, scoped_ptr<PrioritizedTexture> texture) | ||
: LayerUpdater::Texture(texture.Pass()) | ||
, m_updater(updater) | ||
{ | ||
} | ||
|
||
BitmapCanvasLayerUpdater::Texture::~Texture() | ||
{ | ||
} | ||
|
||
void BitmapCanvasLayerUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) | ||
{ | ||
updater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate); | ||
} | ||
|
||
scoped_refptr<BitmapCanvasLayerUpdater> BitmapCanvasLayerUpdater::create(scoped_ptr<LayerPainter> painter) | ||
{ | ||
return make_scoped_refptr(new BitmapCanvasLayerUpdater(painter.Pass())); | ||
} | ||
|
||
BitmapCanvasLayerUpdater::BitmapCanvasLayerUpdater(scoped_ptr<LayerPainter> painter) | ||
: CanvasLayerUpdater(painter.Pass()) | ||
, m_opaque(false) | ||
{ | ||
} | ||
|
||
BitmapCanvasLayerUpdater::~BitmapCanvasLayerUpdater() | ||
{ | ||
} | ||
|
||
scoped_ptr<LayerUpdater::Texture> BitmapCanvasLayerUpdater::createTexture(PrioritizedTextureManager* manager) | ||
{ | ||
return scoped_ptr<LayerUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager))); | ||
} | ||
|
||
void BitmapCanvasLayerUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, float contentsWidthScale, float contentsHeightScale, IntRect& resultingOpaqueRect, RenderingStats& stats) | ||
{ | ||
if (m_canvasSize != contentRect.size()) { | ||
m_canvasSize = contentRect.size(); | ||
m_canvas = make_scoped_ptr(skia::CreateBitmapCanvas(m_canvasSize.width(), m_canvasSize.height(), m_opaque)); | ||
} | ||
|
||
paintContents(m_canvas.get(), contentRect, contentsWidthScale, contentsHeightScale, resultingOpaqueRect, stats); | ||
} | ||
|
||
void BitmapCanvasLayerUpdater::updateTexture(TextureUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate) | ||
{ | ||
ResourceUpdate upload = ResourceUpdate::Create( | ||
texture, | ||
&m_canvas->getDevice()->accessBitmap(false), | ||
contentRect(), | ||
sourceRect, | ||
destOffset); | ||
if (partialUpdate) | ||
queue.appendPartialUpload(upload); | ||
else | ||
queue.appendFullUpload(upload); | ||
} | ||
|
||
void BitmapCanvasLayerUpdater::setOpaque(bool opaque) | ||
{ | ||
if (opaque != m_opaque) { | ||
m_canvas.reset(); | ||
m_canvasSize = IntSize(); | ||
} | ||
m_opaque = opaque; | ||
} | ||
|
||
} // namespace cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.