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

Side by Side Diff: cc/gl_renderer.cc

Issue 11358050: Remove most remaining webcore points and sizes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebasedd Created 8 years, 1 month 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/draw_quad_unittest.cc ('k') | cc/heads_up_display_layer.h » ('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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/gl_renderer.h" 7 #include "cc/gl_renderer.h"
8 8
9 #include "FloatQuad.h" 9 #include "FloatQuad.h"
10 #include "NotImplemented.h" 10 #include "NotImplemented.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 366
367 WebGraphicsContext3D* filterContext = getFilterContext(); 367 WebGraphicsContext3D* filterContext = getFilterContext();
368 GrContext* filterGrContext = getFilterGrContext(); 368 GrContext* filterGrContext = getFilterGrContext();
369 369
370 if (!filterContext || !filterGrContext) 370 if (!filterContext || !filterGrContext)
371 return SkBitmap(); 371 return SkBitmap();
372 372
373 renderer->context()->flush(); 373 renderer->context()->flush();
374 374
375 ResourceProvider::ScopedWriteLockGL lock(renderer->resourceProvider(), sourc eTexture->id()); 375 ResourceProvider::ScopedWriteLockGL lock(renderer->resourceProvider(), sourc eTexture->id());
376 SkBitmap source = RenderSurfaceFilters::apply(filters, lock.textureId(), cc: :IntSize(sourceTexture->size()), filterContext, filterGrContext); 376 SkBitmap source = RenderSurfaceFilters::apply(filters, lock.textureId(), sou rceTexture->size(), filterContext, filterGrContext);
377 return source; 377 return source;
378 } 378 }
379 379
380 static SkBitmap applyImageFilter(GLRenderer* renderer, SkImageFilter* filter, Sc opedTexture* sourceTexture) 380 static SkBitmap applyImageFilter(GLRenderer* renderer, SkImageFilter* filter, Sc opedTexture* sourceTexture)
381 { 381 {
382 if (!filter) 382 if (!filter)
383 return SkBitmap(); 383 return SkBitmap();
384 384
385 WebGraphicsContext3D* context3d = getFilterContext(); 385 WebGraphicsContext3D* context3d = getFilterContext();
386 GrContext* grContext = getFilterGrContext(); 386 GrContext* grContext = getFilterGrContext();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 return scoped_ptr<ScopedTexture>(); 470 return scoped_ptr<ScopedTexture>();
471 471
472 SkBitmap filteredDeviceBackground = applyFilters(this, filters, deviceBackgr oundTexture.get()); 472 SkBitmap filteredDeviceBackground = applyFilters(this, filters, deviceBackgr oundTexture.get());
473 if (!filteredDeviceBackground.getTexture()) 473 if (!filteredDeviceBackground.getTexture())
474 return scoped_ptr<ScopedTexture>(); 474 return scoped_ptr<ScopedTexture>();
475 475
476 GrTexture* texture = reinterpret_cast<GrTexture*>(filteredDeviceBackground.g etTexture()); 476 GrTexture* texture = reinterpret_cast<GrTexture*>(filteredDeviceBackground.g etTexture());
477 int filteredDeviceBackgroundTextureId = texture->getTextureHandle(); 477 int filteredDeviceBackgroundTextureId = texture->getTextureHandle();
478 478
479 scoped_ptr<ScopedTexture> backgroundTexture = ScopedTexture::create(m_resour ceProvider); 479 scoped_ptr<ScopedTexture> backgroundTexture = ScopedTexture::create(m_resour ceProvider);
480 if (!backgroundTexture->allocate(Renderer::ImplPool, cc::IntSize(quad->quadR ect().size()), GL_RGBA, ResourceProvider::TextureUsageFramebuffer)) 480 if (!backgroundTexture->allocate(Renderer::ImplPool, quad->quadRect().size() , GL_RGBA, ResourceProvider::TextureUsageFramebuffer))
481 return scoped_ptr<ScopedTexture>(); 481 return scoped_ptr<ScopedTexture>();
482 482
483 const RenderPass* targetRenderPass = frame.currentRenderPass; 483 const RenderPass* targetRenderPass = frame.currentRenderPass;
484 bool usingBackgroundTexture = useScopedTexture(frame, backgroundTexture.get( ), quad->quadRect()); 484 bool usingBackgroundTexture = useScopedTexture(frame, backgroundTexture.get( ), quad->quadRect());
485 485
486 if (usingBackgroundTexture) { 486 if (usingBackgroundTexture) {
487 // Copy the readback pixels from device to the background texture for th e surface. 487 // Copy the readback pixels from device to the background texture for th e surface.
488 WebTransformationMatrix deviceToFramebufferTransform; 488 WebTransformationMatrix deviceToFramebufferTransform;
489 deviceToFramebufferTransform.translate(quad->quadRect().width() / 2.0, q uad->quadRect().height() / 2.0); 489 deviceToFramebufferTransform.translate(quad->quadRect().width() / 2.0, q uad->quadRect().height() / 2.0);
490 deviceToFramebufferTransform.scale3d(quad->quadRect().width(), quad->qua dRect().height(), 1); 490 deviceToFramebufferTransform.scale3d(quad->quadRect().width(), quad->qua dRect().height(), 1);
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 1626
1627 releaseRenderPassTextures(); 1627 releaseRenderPassTextures();
1628 } 1628 }
1629 1629
1630 bool GLRenderer::isContextLost() 1630 bool GLRenderer::isContextLost()
1631 { 1631 {
1632 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); 1632 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR);
1633 } 1633 }
1634 1634
1635 } // namespace cc 1635 } // namespace cc
OLDNEW
« no previous file with comments | « cc/draw_quad_unittest.cc ('k') | cc/heads_up_display_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698