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

Unified Diff: cc/layers/layer_impl.cc

Issue 17335011: cc: Allow output readback/copy requests to specify a sub-rect to copy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copy-subrect: 3 patches in one Created 7 years, 6 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/layers/layer_impl.h ('k') | cc/output/copy_output_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index eb50b61cbe12936bd9d0dfde9ac04e4b7bdef212..b04f1224d4f9674b28c19b83f903e724be67a28e 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -113,12 +113,26 @@ void LayerImpl::PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests) {
NoteLayerPropertyChangedForSubtree();
}
-void LayerImpl::TakeCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests) {
+void LayerImpl::TakeCopyRequestsAndTransformToTarget(
+ ScopedPtrVector<CopyOutputRequest>* requests) {
if (copy_requests_.empty())
return;
requests->insert_and_take(requests->end(), copy_requests_);
copy_requests_.clear();
+
+ for (size_t i = 0; i < requests->size(); ++i) {
+ CopyOutputRequest* request = requests->at(i);
+ if (!request->has_area())
+ continue;
+
+ gfx::Rect request_in_layer_space = request->area();
+ gfx::Rect request_in_content_space =
+ LayerRectToContentRect(request_in_layer_space);
+ request->set_area(
+ MathUtil::MapClippedRect(draw_properties_.target_space_transform,
+ request_in_content_space));
+ }
}
void LayerImpl::CreateRenderSurface() {
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/output/copy_output_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698