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

Side by Side Diff: cc/resource_provider.cc

Issue 11269017: Plumb through cropped output size for VideoFrame (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Created 8 years, 2 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
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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/resource_provider.h" 7 #include "cc/resource_provider.h"
8 8
9 #include <limits.h> 9 #include <limits.h>
10 10
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 context3d->bindTexture(GL_TEXTURE_2D, resource->glId); 283 context3d->bindTexture(GL_TEXTURE_2D, resource->glId);
284 m_textureUploader->upload(image, 284 m_textureUploader->upload(image,
285 imageRect, 285 imageRect,
286 sourceRect, 286 sourceRect,
287 destOffset, 287 destOffset,
288 resource->format, 288 resource->format,
289 resource->size); 289 resource->size);
290 } 290 }
291 291
292 if (resource->pixels) { 292 if (resource->pixels) {
293 DCHECK(resource->format == GL_RGBA);
293 SkBitmap srcFull; 294 SkBitmap srcFull;
294 srcFull.setConfig(SkBitmap::kARGB_8888_Config, imageRect.width(), imageR ect.height()); 295 srcFull.setConfig(SkBitmap::kARGB_8888_Config, imageRect.width(), imageR ect.height());
295 srcFull.setPixels(const_cast<uint8_t*>(image)); 296 srcFull.setPixels(const_cast<uint8_t*>(image));
296 SkBitmap srcSubset; 297 SkBitmap srcSubset;
297 SkIRect skSourceRect = SkIRect::MakeXYWH(sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height()); 298 SkIRect skSourceRect = SkIRect::MakeXYWH(sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height());
298 skSourceRect.offset(-imageRect.x(), -imageRect.y()); 299 skSourceRect.offset(-imageRect.x(), -imageRect.y());
299 srcFull.extractSubset(&srcSubset, skSourceRect); 300 srcFull.extractSubset(&srcSubset, skSourceRect);
300 301
301 ScopedWriteLockSoftware lock(this, id); 302 ScopedWriteLockSoftware lock(this, id);
302 SkCanvas* dest = lock.skCanvas(); 303 SkCanvas* dest = lock.skCanvas();
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 g_debugZone = zone; 709 g_debugZone = zone;
709 } 710 }
710 711
711 void ResourceProvider::debugNotifyLeaveZone() 712 void ResourceProvider::debugNotifyLeaveZone()
712 { 713 {
713 g_debugZone = 0; 714 g_debugZone = 0;
714 } 715 }
715 716
716 717
717 } 718 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698