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

Side by Side Diff: cc/software_renderer.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 | « cc/scrollbar_layer_impl.cc ('k') | cc/test/render_pass_test_common.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/software_renderer.h" 5 #include "cc/software_renderer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/debug_border_draw_quad.h" 8 #include "cc/debug_border_draw_quad.h"
9 #include "cc/math_util.h" 9 #include "cc/math_util.h"
10 #include "cc/render_pass_draw_quad.h" 10 #include "cc/render_pass_draw_quad.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 void SoftwareRenderer::drawTextureQuad(const DrawingFrame& frame, const TextureD rawQuad* quad) 252 void SoftwareRenderer::drawTextureQuad(const DrawingFrame& frame, const TextureD rawQuad* quad)
253 { 253 {
254 if (!isSoftwareResource(quad->resource_id)) { 254 if (!isSoftwareResource(quad->resource_id)) {
255 drawUnsupportedQuad(frame, quad); 255 drawUnsupportedQuad(frame, quad);
256 return; 256 return;
257 } 257 }
258 258
259 // FIXME: Add support for non-premultiplied alpha. 259 // FIXME: Add support for non-premultiplied alpha.
260 ResourceProvider::ScopedReadLockSoftware lock(m_resourceProvider, quad->reso urce_id); 260 ResourceProvider::ScopedReadLockSoftware lock(m_resourceProvider, quad->reso urce_id);
261 const SkBitmap* bitmap = lock.skBitmap(); 261 const SkBitmap* bitmap = lock.skBitmap();
262 gfx::RectF uvRect = gfx::ScaleRect(quad->uv_rect, bitmap->width(), bitmap->h eight()); 262 gfx::RectF uvRect = gfx::ScaleRect(gfx::BoundingRect(quad->uv_top_left, quad ->uv_bottom_right),
263 bitmap->width(),
264 bitmap->height());
263 SkRect skUvRect = gfx::RectFToSkRect(uvRect); 265 SkRect skUvRect = gfx::RectFToSkRect(uvRect);
264 if (quad->flipped) 266 if (quad->flipped)
265 m_skCurrentCanvas->scale(1, -1); 267 m_skCurrentCanvas->scale(1, -1);
266 m_skCurrentCanvas->drawBitmapRectToRect(*bitmap, &skUvRect, 268 m_skCurrentCanvas->drawBitmapRectToRect(*bitmap, &skUvRect,
267 gfx::RectFToSkRect(quadVertexRect()) , 269 gfx::RectFToSkRect(quadVertexRect()) ,
268 &m_skCurrentPaint); 270 &m_skCurrentPaint);
269 } 271 }
270 272
271 void SoftwareRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQua d* quad) 273 void SoftwareRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQua d* quad)
272 { 274 {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 372 }
371 373
372 void SoftwareRenderer::setVisible(bool visible) 374 void SoftwareRenderer::setVisible(bool visible)
373 { 375 {
374 if (m_visible == visible) 376 if (m_visible == visible)
375 return; 377 return;
376 m_visible = visible; 378 m_visible = visible;
377 } 379 }
378 380
379 } // namespace cc 381 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scrollbar_layer_impl.cc ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698