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

Side by Side Diff: cc/output/gl_renderer.h

Issue 614953002: Accelerate the lighten blendmode if GL_EXT_blend_minmax is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « no previous file | cc/output/gl_renderer.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 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 #ifndef CC_OUTPUT_GL_RENDERER_H_ 5 #ifndef CC_OUTPUT_GL_RENDERER_H_
6 #define CC_OUTPUT_GL_RENDERER_H_ 6 #define CC_OUTPUT_GL_RENDERER_H_
7 7
8 #include "base/cancelable_callback.h" 8 #include "base/cancelable_callback.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 #include "cc/base/scoped_ptr_deque.h" 10 #include "cc/base/scoped_ptr_deque.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 private: 136 private:
137 friend class GLRendererShaderPixelTest; 137 friend class GLRendererShaderPixelTest;
138 friend class GLRendererShaderTest; 138 friend class GLRendererShaderTest;
139 139
140 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform); 140 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform);
141 141
142 void DrawCheckerboardQuad(const DrawingFrame* frame, 142 void DrawCheckerboardQuad(const DrawingFrame* frame,
143 const CheckerboardDrawQuad* quad); 143 const CheckerboardDrawQuad* quad);
144 void DrawDebugBorderQuad(const DrawingFrame* frame, 144 void DrawDebugBorderQuad(const DrawingFrame* frame,
145 const DebugBorderDrawQuad* quad); 145 const DebugBorderDrawQuad* quad);
146 static bool ShouldApplyBlendModeUsingBlendFunc(const DrawQuad* quad); 146 static bool IsDefaultBlendMode(SkXfermode::Mode blend_mode) {
147 void ApplyBlendModeUsingBlendFunc(const DrawQuad* quad); 147 return blend_mode == SkXfermode::kSrcOver_Mode;
148 void RestoreBlendFuncToDefault(); 148 }
149 bool CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode);
150 void ApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode);
151 void RestoreBlendFuncToDefault(SkXfermode::Mode blend_mode);
149 152
150 gfx::Rect GetBackdropBoundingBoxForRenderPassQuad( 153 gfx::Rect GetBackdropBoundingBoxForRenderPassQuad(
151 DrawingFrame* frame, 154 DrawingFrame* frame,
152 const RenderPassDrawQuad* quad, 155 const RenderPassDrawQuad* quad,
153 const gfx::Transform& contents_device_transform); 156 const gfx::Transform& contents_device_transform);
154 scoped_ptr<ScopedResource> GetBackdropTexture(const gfx::Rect& bounding_rect); 157 scoped_ptr<ScopedResource> GetBackdropTexture(const gfx::Rect& bounding_rect);
155 158
156 static bool ShouldApplyBackgroundFilters(DrawingFrame* frame, 159 static bool ShouldApplyBackgroundFilters(DrawingFrame* frame,
157 const RenderPassDrawQuad* quad); 160 const RenderPassDrawQuad* quad);
158 skia::RefPtr<SkImage> ApplyBackgroundFilters( 161 skia::RefPtr<SkImage> ApplyBackgroundFilters(
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 struct PendingAsyncReadPixels; 432 struct PendingAsyncReadPixels;
430 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; 433 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_;
431 434
432 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; 435 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_;
433 436
434 class SyncQuery; 437 class SyncQuery;
435 ScopedPtrDeque<SyncQuery> pending_sync_queries_; 438 ScopedPtrDeque<SyncQuery> pending_sync_queries_;
436 ScopedPtrDeque<SyncQuery> available_sync_queries_; 439 ScopedPtrDeque<SyncQuery> available_sync_queries_;
437 scoped_ptr<SyncQuery> current_sync_query_; 440 scoped_ptr<SyncQuery> current_sync_query_;
438 bool use_sync_query_; 441 bool use_sync_query_;
442 bool use_blend_minmax;
piman 2014/10/09 22:32:15 drive-by nit: use_blend_minmax_
439 443
440 SkBitmap on_demand_tile_raster_bitmap_; 444 SkBitmap on_demand_tile_raster_bitmap_;
441 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; 445 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_;
442 446
443 DISALLOW_COPY_AND_ASSIGN(GLRenderer); 447 DISALLOW_COPY_AND_ASSIGN(GLRenderer);
444 }; 448 };
445 449
446 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL 450 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL
447 // call made by the compositor. Useful for debugging rendering issues but 451 // call made by the compositor. Useful for debugging rendering issues but
448 // will significantly degrade performance. 452 // will significantly degrade performance.
449 #define DEBUG_GL_CALLS 0 453 #define DEBUG_GL_CALLS 0
450 454
451 #if DEBUG_GL_CALLS && !defined(NDEBUG) 455 #if DEBUG_GL_CALLS && !defined(NDEBUG)
452 #define GLC(context, x) \ 456 #define GLC(context, x) \
453 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) 457 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__))
454 #else 458 #else
455 #define GLC(context, x) (x) 459 #define GLC(context, x) (x)
456 #endif 460 #endif
457 461
458 } // namespace cc 462 } // namespace cc
459 463
460 #endif // CC_OUTPUT_GL_RENDERER_H_ 464 #endif // CC_OUTPUT_GL_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698