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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_compositing_helper.cc

Issue 11783094: cc: Add point-based UV coordinate on TextureLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/cc_messages_unittest.cc ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/browser_plugin/browser_plugin_compositing_helper.h" 5 #include "content/renderer/browser_plugin/browser_plugin_compositing_helper.h"
6 6
7 #include "cc/texture_layer.h" 7 #include "cc/texture_layer.h"
8 #include "content/common/browser_plugin_messages.h" 8 #include "content/common/browser_plugin_messages.h"
9 #include "content/renderer/render_thread_impl.h" 9 #include "content/renderer/render_thread_impl.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 if (!texture_layer_) 87 if (!texture_layer_)
88 return; 88 return;
89 89
90 gfx::RectF uv_rect(0, 0, 1, 1); 90 gfx::RectF uv_rect(0, 0, 1, 1);
91 if (!buffer_size_.IsEmpty() && !container_size_.IsEmpty()) { 91 if (!buffer_size_.IsEmpty() && !container_size_.IsEmpty()) {
92 uv_rect.set_width(static_cast<float>(container_size_.width()) / 92 uv_rect.set_width(static_cast<float>(container_size_.width()) /
93 static_cast<float>(buffer_size_.width())); 93 static_cast<float>(buffer_size_.width()));
94 uv_rect.set_height(static_cast<float>(container_size_.height()) / 94 uv_rect.set_height(static_cast<float>(container_size_.height()) /
95 static_cast<float>(buffer_size_.height())); 95 static_cast<float>(buffer_size_.height()));
96 } 96 }
97 texture_layer_->setUVRect(uv_rect); 97 texture_layer_->setUV(uv_rect.origin(), uv_rect.bottom_right());
98 } 98 }
99 99
100 } // namespace content 100 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cc_messages_unittest.cc ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698